Skip to content

Commit 10e0b01

Browse files
committed
[cmake] Force-set the ZLIB_LIBRARY
Apparently cmake sets the cache after the configuration is complete and using FORCE updates the cache at the spot 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" ```
1 parent 71e6ed3 commit 10e0b01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtins/zlib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ endif()
126126

127127
add_library(ZLIB::ZLIB ALIAS ZLIB)
128128

129-
set(ZLIB_LIBRARY $<TARGET_FILE:ZLIB> CACHE INTERNAL "")
129+
set(ZLIB_LIBRARY $<TARGET_FILE:ZLIB::ZLIB> CACHE INTERNAL FORCE "")
130130
set(ZLIB_LIBRARIES ZLIB::ZLIB CACHE INTERNAL "")
131131

132132
if(DEFINED ZLIB_LIBRARY_DEBUG)

0 commit comments

Comments
 (0)