This is an archive of the discontinued LLVM Phabricator instance.

lib/Header: Fix Visual Studio builds try #2
ClosedPublic

Authored by tstellar on Apr 26 2019, 9:32 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellar created this revision.Apr 26 2019, 9:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2019, 9:32 PM
Herald added a subscriber: mgorny. · View Herald Transcript
vzakhari added inline comments.Apr 27 2019, 6:23 PM
clang/lib/Headers/CMakeLists.txt
173 ↗(On Diff #196947)

Please add "/include" at the end.

176 ↗(On Diff #196947)

This is going to flatten the headers' install directory structure. install() will put the files just by their name.

I had a local fix that use install() with RENAME, and it worked. I can try to find it. Basically, we need to keep two lists:

  1. The same as this ${install_files}
  2. New list install_as, which holds all $Missing path, expected "{src path ...}" in: {src} values passed to copy_header_to_output_dir()

Walking the two lists together we may use install(FILES ${elt_from_install_files} RENAME ${elt_from_install_as} ...)

vzakhari added inline comments.Apr 29 2019, 11:41 AM
clang/lib/Headers/CMakeLists.txt
176 ↗(On Diff #196947)

Correction.

New list install_as, which holds all $Missing path, expected "{src path ...}" in: {src} values passed to copy_header_to_output_dir()

Should be
New list install_as, which holds all ${file} values passed to copy_header_to_output_dir()

tstellar updated this revision to Diff 197233.Apr 29 2019, 5:38 PM
  • Fix install directory
  • Use a separate install targets for each sub-directory like it was done before r355253.

OK, this should work while clang_generate_header() is used for plain files.

vzakhari accepted this revision.Apr 29 2019, 5:49 PM
This revision is now accepted and ready to land.Apr 29 2019, 5:49 PM
tstellar updated this revision to Diff 197244.Apr 29 2019, 7:08 PM
tstellar marked an inline comment as done.

Make sure to install the generated files.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2019, 11:15 PM