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

Before 6db314e86b, 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 6db314e86b, 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.
This commit is contained in:
Nico Weber
2020-11-01 21:34:51 -05:00
parent 24a31922ce
commit 8954fd436c

View File

@@ -224,7 +224,7 @@ if(LIBCXX_HEADER_DIR)
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${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})