Make LIBCXX_STANDARD_VER configurable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6b05b6..5567e82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -526,11 +526,12 @@
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}")
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 7c5096d..e5313f1 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -328,7 +328,7 @@
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