8000 lib/Header: Fix Visual Studio builds try #2 · llvm/llvm-project@dbe1c4a · GitHub
[go: up one dir, main page]

Skip to content

Commit dbe1c4a

Browse files
committed
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 llvm-svn: 359654
1 parent 4672e52 commit dbe1c4a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

clang/lib/Headers/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ set(ppc_wrapper_files
128128

129129
set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
130130
set(out_files)
131+
set(generated_files)
131132

132133
function(copy_header_to_output_dir src_dir file)
133134
set(src ${src_dir}/${file})
@@ -147,6 +148,8 @@ function(clang_generate_header td_option td_file out_file)
147148

148149
copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
149150
set(out_files ${out_files} PARENT_SCOPE)
151+
list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
152+
set(generated_files ${generated_files} PARENT_SCOPE)
150153
endfunction(clang_generate_header)
151154

152155

@@ -166,13 +169,23 @@ set_target_properties(clang-resource-headers PROPERTIES
166169
FOLDER "Misc"
167170
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
168171

169-
set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
172+
set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
170173

171174
install(
172-
DIRECTORY ${output_dir}
175+
FILES ${files} ${generated_files}
173176
DESTINATION ${header_install_dir}
174177
COMPONENT clang-resource-headers)
175178

179+
install(
180+
FILES ${cuda_wrapper_files}
181+
DESTINATION ${header_install_dir}/cuda_wrappers
182+
COMPONENT clang-resource-headers)
183+
184+
install(
185+
FILES ${ppc_wrapper_files}
186+
DESTINATION ${header_install_dir}/ppc_wrappers
187+
COMPONENT clang-resource-headers)
188+
176189
if (NOT LLVM_ENABLE_IDE)
177190
add_llvm_install_targets(install-clang-resource-headers
178191
DEPENDS clang-resource-headers

0 commit comments

Comments
 (0)
0