Skip to content

Commit

Permalink
[cmake] Force-set the ZLIB_LIBRARY
Browse files Browse the repository at this point in the history
Apparently cmake sets the cache after the configuration is complete and using
FORCE updates the cache including the relevant generator expressions.

This fixes the case where we build ROOT with -Dbuiltin_zlib=Off and then LLVM
sanity checks the found zlib issuing:

```
Error evaluating generator expression:

  $<TARGET_FILE:ZLIB>

No target "ZLIB"
```
  • Loading branch information
vgvassilev committed Apr 2, 2022
1 parent 686b160 commit 7f410fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtins/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ endif()

add_library(ZLIB::ZLIB ALIAS ZLIB)

set(ZLIB_LIBRARY $<TARGET_FILE:ZLIB> CACHE INTERNAL "")
set(ZLIB_LIBRARY $<TARGET_FILE:ZLIB::ZLIB> CACHE INTERNAL FORCE "")
set(ZLIB_LIBRARIES ZLIB::ZLIB CACHE INTERNAL "")

if(DEFINED ZLIB_LIBRARY_DEBUG)
Expand Down

0 comments on commit 7f410fc

Please sign in to comment.