From 9627b26c40a19ce904921148f7be4cb84fd9e796 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Fri, 4 Oct 2019 23:08:20 +0000 Subject: [PATCH] [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. llvm-svn: 373809 --- libcxx/src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 1b18850..03bc126 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -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) -- 2.7.4