This is an archive of the discontinued LLVM Phabricator instance.

[libunwind][CMake] Add cached compile and link flags to libunwind
ClosedPublic

Authored by mgrzywac on May 10 2023, 12:38 AM.

Details

Reviewers
phosek
Group Reviewers
Restricted Project
Commits
rG9e37142dc12a: [libunwind] Add cached compile and link flags to libunwind
Summary

Add flags allowing to use compile flags and libraries provided in cache with libunwind.
Similar flags are already present in libc++ and libc++abi CMakeLists files.

Diff Detail

Event Timeline

mgrzywac created this revision.May 10 2023, 12:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 12:38 AM
Herald added a subscriber: ekilmer. · View Herald Transcript
mgrzywac requested review of this revision.May 10 2023, 12:38 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptMay 10 2023, 12:38 AM
ldionne added inline comments.
libunwind/CMakeLists.txt
159–160

Could you instead do target_compile_options(${target} PUBLIC "${LIBUNWIND_ADDITIONAL_COMPILE_FLAGS}") in libunwind/src for unwind_static and unwind_shared? And target_link_libraries(${target} PUBLIC "${LIBUNWIND_ADDITIONAL_LIBRARIES}") for the libraries part.

We're trying to move away from global functions like add_compile_flags and add_library_flags.

mgrzywac updated this revision to Diff 521264.May 11 2023, 5:12 AM

Moved flag and libs addition to libunwind/src

libunwind/CMakeLists.txt
159–160

Sure, I moved flag and libs addition.

phosek accepted this revision.May 15 2023, 12:01 PM
phosek added a subscriber: phosek.

LGTM

This revision is now accepted and ready to land.May 15 2023, 12:01 PM

I don't have commit access, can you please land this for me? Please use Maciej Grzywacz maciej.grzywacz@intel.com for the commit :)

Hi @phosek, could You land this change for me? This is my first change and I don't have commit access yet :)