From 72b41e6e2d560aee6f52b2f1db385972053bc7d1 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 11 Dec 2019 20:26:30 -0500 Subject: [PATCH] [libc++] Require C++14 in all cases. LLVM has moved to C++14, and the libc++ build should too. C++14 is needed to provide constant initialization for certain global objects. I suspect this change may break some older GCC buildbots, and I'll clean those up as they fall. --- libcxx/CMakeLists.txt | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index fa488da0885f..443097c090e6 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -518,19 +518,13 @@ remove_flags(-Wno-pedantic -pedantic-errors -pedantic) # Required flags ============================================================== function(cxx_add_basic_build_flags target) - 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_target_properties(${target} PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED YES - CXX_EXTENSIONS NO) - else() - set_target_properties(${target} PROPERTIES - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED YES - CXX_EXTENSIONS NO) - endif() + + # Require C++14 for all targets. C++14 is needed to ensure constant + # initialization for certain globals (ex global memory resources). + set_target_properties(${target} PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED YES + CXX_EXTENSIONS NO) # On all systems the system c++ standard library headers need to be excluded. # MSVC only has -X, which disables all default includes; including the crt.