summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2019-05-01 06:18:03 +0000
committerTom Stellard <tstellar@redhat.com>2019-05-01 06:18:03 +0000
commita0b7c9ab792d9fbbf1481e203c7c0d34666eea84 (patch)
treef44d10275a7f14a0a63d49576e7309686ac04783
parent9f6cfd8878f210c55a1c7463ddc9225b33ece398 (diff)
lib/Header: Fix Visual Studio builds try #2
Summary: This is a follow up to r355253 and a better fix than the first attempt which was r359257. We can't install anything from ${CMAKE_CFG_INTDIR}, because this value is only defined at build time, but we still must make sure to copy the headers into ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include, because the lit tests look for headers there. So for this fix we revert to the old behavior of copying the headers to ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include during the build and then installing them from the source tree. Reviewers: smeenai, vzakhari, phosek Reviewed By: smeenai, vzakhari Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61220 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359654 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Headers/CMakeLists.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
index 04c5edb0e8..a921d99399 100644
--- a/lib/Headers/CMakeLists.txt
+++ b/lib/Headers/CMakeLists.txt
@@ -128,6 +128,7 @@ set(ppc_wrapper_files
set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
set(out_files)
+set(generated_files)
function(copy_header_to_output_dir src_dir file)
set(src ${src_dir}/${file})
@@ -147,6 +148,8 @@ function(clang_generate_header td_option td_file out_file)
copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
set(out_files ${out_files} PARENT_SCOPE)
+ list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
+ set(generated_files ${generated_files} PARENT_SCOPE)
endfunction(clang_generate_header)
@@ -166,13 +169,23 @@ set_target_properties(clang-resource-headers PROPERTIES
FOLDER "Misc"
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
install(
- DIRECTORY ${output_dir}
+ FILES ${files} ${generated_files}
DESTINATION ${header_install_dir}
COMPONENT clang-resource-headers)
+install(
+ FILES ${cuda_wrapper_files}
+ DESTINATION ${header_install_dir}/cuda_wrappers
+ COMPONENT clang-resource-headers)
+
+install(
+ FILES ${ppc_wrapper_files}
+ DESTINATION ${header_install_dir}/ppc_wrappers
+ COMPONENT clang-resource-headers)
+
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers