[libcxx-commits] [PATCH] D83911: [libcxx] Move the libc++ header paths to the common location
Petr Hosek via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 7 15:18:21 PDT 2020
phosek updated this revision to Diff 296816.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83911/new/
https://reviews.llvm.org/D83911
Files:
libcxx/CMakeLists.txt
libcxx/include/CMakeLists.txt
Index: libcxx/include/CMakeLists.txt
===================================================================
--- libcxx/include/CMakeLists.txt
+++ libcxx/include/CMakeLists.txt
@@ -203,12 +203,10 @@
DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
if(LIBCXX_HEADER_DIR)
- set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1)
-
set(out_files)
foreach(f ${files})
set(src ${CMAKE_CURRENT_SOURCE_DIR}/${f})
- set(dst ${output_dir}/${f})
+ set(dst ${LIBCXX_HEADER_DIR}/${f})
add_custom_command(OUTPUT ${dst}
DEPENDS ${src}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
@@ -218,7 +216,7 @@
# Copy the generated header as __config into build directory.
set(src ${LIBCXX_BINARY_DIR}/__generated_config)
- set(dst ${output_dir}/__config)
+ set(dst ${LIBCXX_HEADER_DIR}/__config)
add_custom_command(OUTPUT ${dst}
DEPENDS ${src} cxx-generated-config
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
@@ -230,9 +228,9 @@
add_dependencies(cxx-headers generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET})
# TODO: Use target_include_directories once we figure out why that breaks the runtimes build
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
- target_compile_options(cxx-headers INTERFACE /I "${output_dir}")
+ target_compile_options(cxx-headers INTERFACE /I "${LIBCXX_HEADER_DIR}")
else()
- target_compile_options(cxx-headers INTERFACE -I "${output_dir}")
+ target_compile_options(cxx-headers INTERFACE -I "${LIBCXX_HEADER_DIR}")
endif()
# Make sure the generated __config_site header is included when we build the library.
@@ -249,7 +247,7 @@
foreach(file ${files})
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${file}
- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir}
+ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${LIBCXX_INSTALL_HEADER_DIR}/${dir}
COMPONENT cxx-headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -399,20 +399,23 @@
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
- set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})
+ set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}/include/c++/v1)
set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++)
+ set(LIBCXX_INSTALL_HEADER_DIR include/c++/v1)
if(LIBCXX_LIBDIR_SUBDIR)
string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR})
string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR})
endif()
elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
- set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR})
+ set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}/include/c++/v1)
set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX})
+ set(LIBCXX_INSTALL_HEADER_DIR include/c++/v1)
else()
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
- set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR})
+ set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR}/include/c++/v1)
set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX})
+ set(LIBCXX_INSTALL_HEADER_DIR include/c++/v1)
endif()
file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83911.296816.patch
Type: text/x-patch
Size: 3483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201007/84b04c7c/attachment.bin>
More information about the libcxx-commits
mailing list