[libcxx-commits] [libcxx] r373809 - [libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY

Alex Langford via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 4 16:08:20 PDT 2019


Author: xiaobai
Date: Fri Oct  4 16:08:20 2019
New Revision: 373809

URL: http://llvm.org/viewvc/llvm-project?rev=373809&view=rev
Log:
[libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY

If you explicitly set LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY to OFF, your
project will fail to configure because the cxx_experimental target
doesn't exist.

Modified:
    libcxx/trunk/src/CMakeLists.txt

Modified: libcxx/trunk/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/CMakeLists.txt?rev=373809&r1=373808&r2=373809&view=diff
==============================================================================
--- libcxx/trunk/src/CMakeLists.txt (original)
+++ libcxx/trunk/src/CMakeLists.txt Fri Oct  4 16:08:20 2019
@@ -395,14 +395,14 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
       COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
       OUTPUT_NAME   "c++experimental"
   )
+  cxx_add_common_build_flags(cxx_experimental)
+  # Overwrite the previously-set Standard flag with -std=c++14 if supported
+  check_flag_supported(-std=c++14)
+  if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG)
+    target_compile_options(cxx_experimental PRIVATE "-std=c++14")
+  endif()
 endif()
-cxx_add_common_build_flags(cxx_experimental)
 
-# Overwrite the previously-set Standard flag with -std=c++14 if supported
-check_flag_supported(-std=c++14)
-if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG)
-  target_compile_options(cxx_experimental PRIVATE "-std=c++14")
-endif()
 
 if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
   file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)




More information about the libcxx-commits mailing list