Make LIBCXX_STANDARD_VER configurable

llvm-svn: 353649
This commit is contained in:
Eric Fiselier 2019-02-10 18:27:55 +00:00
parent a303186ef3
commit 9d487c7d1e
2 changed files with 4 additions and 3 deletions

View File

@ -526,11 +526,12 @@ remove_flags("/D_DEBUG" "/MTd" "/MDd" "/MT" "/Md")
remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
# Required flags ==============================================================
set(LIBCXX_STANDARD_VER c++11 CACHE INTERNAL "internal option to change build dialect")
if (LIBCXX_HAS_MUSL_LIBC OR LIBCXX_TARGETING_CLANG_CL)
# musl's pthread implementations uses volatile types in their structs which is
# not a constexpr in C++11 but is in C++14, so we use C++14 with musl.
set(LIBCXX_STANDARD_VER c++14 CACHE INTERNAL "internal option to change build dialect")
set(LIBCXX_STANDARD_VER c++14 CACHE STRING "internal option to change build dialect")
else()
set(LIBCXX_STANDARD_VER c++11 CACHE STRING "internal option to change build dialect")
endif()
add_compile_flags_if_supported(-std=${LIBCXX_STANDARD_VER})
add_compile_flags_if_supported("/std:${LIBCXX_STANDARD_VER}")

View File

@ -328,7 +328,7 @@ if (LIBCXX_ENABLE_FILESYSTEM)
set(filesystem_flags "${LIBCXX_COMPILE_FLAGS}")
check_flag_supported(-std=c++14)
if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG)
if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG AND LIBCXX_STANDARD_VER STREQUAL "c++11")
string(REPLACE "-std=c++11" "-std=c++14" filesystem_flags "${LIBCXX_COMPILE_FLAGS}")
endif()
set_target_properties(cxx_filesystem