[libc++] Require a C++20 capable compiler.
authorMark de Wever <koraq@xs4all.nl>
Thu, 23 Sep 2021 16:15:02 +0000 (12:15 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Fri, 24 Sep 2021 15:38:26 +0000 (11:38 -0400)
This enforces libcxx and its benchmarks are compiled by a C++20 capable
compiler. Based on review comments in D103413.

Differential Revision: https://reviews.llvm.org/D110338

libcxx/CMakeLists.txt
libcxx/benchmarks/CMakeLists.txt

index 924a9f1..6ab44e5 100644 (file)
@@ -537,7 +537,7 @@ function(cxx_add_basic_build_flags target)
   # in the dylib. C++20 is needed to use char8_t.
   set_target_properties(${target} PROPERTIES
     CXX_STANDARD 20
-    CXX_STANDARD_REQUIRED NO
+    CXX_STANDARD_REQUIRED YES
     CXX_EXTENSIONS NO)
 
   # When building the dylib, don't warn for unavailable aligned allocation
index 8d83ecd..cad8808 100644 (file)
@@ -81,7 +81,7 @@ set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx)
 set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native)
 
 add_library(               cxx-benchmarks-flags INTERFACE)
-target_compile_features(   cxx-benchmarks-flags INTERFACE cxx_std_17)
+target_compile_features(   cxx-benchmarks-flags INTERFACE cxx_std_20)
 target_compile_options(    cxx-benchmarks-flags INTERFACE -O2 -fsized-deallocation)
 target_include_directories(cxx-benchmarks-flags INTERFACE "${BENCHMARK_LIBCXX_INSTALL}/include"
                                                 INTERFACE "${LIBCXX_SOURCE_DIR}/test/support")