[PATCH] D74176: [CMake] Link against ZLIB::ZLIB
Shoaib Meenai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 10:10:48 PST 2020
smeenai added inline comments.
================
Comment at: llvm/lib/Support/CMakeLists.txt:195
+if(LLVM_ENABLE_ZLIB)
+ get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY IMPORTED_LOCATION_${CMAKE_BUILD_TYPE})
+ get_filename_component(zlib_library ${zlib_library} NAME_WE)
----------------
I tried patching this locally, and for whatever reason, neither `IMPORTED_LOCATION_${CMAKE_BUILD_TYPE}` nor just `IMPORTED_LOCATION` work for me; I have to use `LOCATION`. https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION.html suggests that `LOCATION` (or `LOCATION_<CONFIG>`) is the right thing to do for reading the location as well? I'm on CMake 3.15.1 though, and that part of the help text only appears starting with 3.15.
Furthermore, I don't know how this would work with multi-config generators. Perhaps we should just set up a series of fallbacks?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74176/new/
https://reviews.llvm.org/D74176
More information about the llvm-commits
mailing list