[libcxx-commits] [libcxx] 8954fd4 - [libcxx] Fix regression where `ninja all` doesn't copy libcxx headers

Nico Weber via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 1 18:38:54 PST 2020


Author: Nico Weber
Date: 2020-11-01T21:34:51-05:00
New Revision: 8954fd436c729796615bac11b3553c4341f01a82

URL: https://github.com/llvm/llvm-project/commit/8954fd436c729796615bac11b3553c4341f01a82
DIFF: https://github.com/llvm/llvm-project/commit/8954fd436c729796615bac11b3553c4341f01a82.diff

LOG: [libcxx] Fix regression where `ninja all` doesn't copy libcxx headers

Before 6db314e86b2674, when running cmake with clang, libcxx, and
compiler-rt enabled, building `ninja all` would run the
generate-cxx-headers target, due to the sanitizers depending on it.

After 6db314e86b2674, if LIBCXX_ENABLE_SHARED and LIBCXX_ENABLE_STATIC
and LIBCXX_INCLUDE_TESTS and LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY are
disabled (https://reviews.llvm.org/D82702#2153627), `ninja all`
no longer copies the libcxx headers, which means clang can't compile
programs like `#include <string>` on macOS.

Explicitly add the copy target to the all target to restore the old
behavior.

Added: 
    

Modified: 
    libcxx/include/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 7c97db41bb73..602c0fff1f81 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -224,7 +224,7 @@ if(LIBCXX_HEADER_DIR)
       COMMAND ${CMAKE_COMMAND} -E copy_if_
diff erent ${src} ${dst}
       COMMENT "Copying CXX __config")
   list(APPEND out_files ${dst})
-  add_custom_target(generate-cxx-headers DEPENDS ${out_files})
+  add_custom_target(generate-cxx-headers ALL DEPENDS ${out_files})
 
   add_library(cxx-headers INTERFACE)
   add_dependencies(cxx-headers generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET})


        


More information about the libcxx-commits mailing list