Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

[CMake] Ensure `CLANG_RESOURCE_DIR` is respected
AbandonedPublic

Authored by paperchalice on Oct 26 2022, 6:53 PM.

Details

Summary

Install resource headers correctly, when CLANG_RESOURCE_DIR is set to some non empty string.
Resolves #57708.

Diff Detail

Event Timeline

paperchalice created this revision.Oct 26 2022, 6:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2022, 6:53 PM
Herald added a subscriber: Enna1. · View Herald Transcript
paperchalice requested review of this revision.Oct 26 2022, 6:53 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added subscribers: llvm-commits, openmp-commits, Restricted Project and 2 others. · View Herald Transcript
paperchalice added a comment.EditedOct 26 2022, 7:02 PM

Thanks a lot if someone can commit this change because I don't have the permission.

This change introduces a lot of conditional code, that is not necessary. This change also uses CLANG_ outside clang/ which is messy. and confusing. Please clean up.

Ericson2314 requested changes to this revision.Nov 7 2022, 5:37 AM
This revision now requires changes to proceed.Nov 7 2022, 5:37 AM

Add cmake module to handle clang resource dir.

Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 3:52 AM
paperchalice added inline comments.Nov 11 2022, 4:01 AM
clang/lib/Headers/CMakeLists.txt
285

Another choice is ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}, but the variable CMAKE_CFG_INTDIR is deprecated since 3.21

cmake/Modules/GetClangResourceDir.cmake
13 ↗(On Diff #474715)

Can I always rely on PACKAGE_VERSION?

paperchalice retitled this revision from [CMake] Make sure all headers are installed into `CLANG_RESOURCE_DIR` to [CMake] Ensure `CLANG_RESOURCE_DIR` is respected.Nov 11 2022, 4:07 AM
paperchalice marked 2 inline comments as not done.Nov 16 2022, 2:35 AM
paperchalice added reviewers: tstellar, MaskRay.

Use genex $<CONFIG> due to CMAKE_CFG_INTDIR is deprecated since cmake 3.21.

paperchalice abandoned this revision.Dec 19 2022, 9:37 PM