This is an archive of the discontinued LLVM Phabricator instance.

CMake: Fix map_components macro with LINK_LLVM_DYLIB
Needs ReviewPublic

Authored by jschueller on Jun 10 2023, 12:18 AM.

Details

Summary

Tries to address https://bugs.llvm.org/show_bug.cgi?id=35245

The cmake macro llvm_map_components_to_libnames is advertised in llvm/docs/CMake.rst
But it does not work on archlinux, where LLVM is compiled with LLVM_LINK_LLVM_DYLIB=ON
In that case there are no targets LLVMCore, LLVMEngine, etc..., instead we must link to the "LLVM" target

Else it errors with these kind of errors:
/usr/bin/ld: cannot find -lLLVMCore: No such file or directory

Is even llvm_map_components_to_libnames still relevant these days ?

Diff Detail

Event Timeline

jschueller created this revision.Jun 10 2023, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 12:18 AM
jschueller requested review of this revision.Jun 10 2023, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 12:18 AM
This comment was removed by jschueller.
jschueller edited the summary of this revision. (Show Details)Jun 10 2023, 1:27 AM
jschueller edited the summary of this revision. (Show Details)Jun 10 2023, 3:36 AM