From 7f410fc20a0e438a63311d64bdf348e7b8275ce1 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sat, 2 Apr 2022 20:38:54 +0000 Subject: [PATCH] [cmake] Force-set the ZLIB_LIBRARY 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: $ No target "ZLIB" ``` --- builtins/zlib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtins/zlib/CMakeLists.txt b/builtins/zlib/CMakeLists.txt index 61da09c0c3c40c..aa5755adb5cf38 100644 --- a/builtins/zlib/CMakeLists.txt +++ b/builtins/zlib/CMakeLists.txt @@ -126,7 +126,7 @@ endif() add_library(ZLIB::ZLIB ALIAS ZLIB) -set(ZLIB_LIBRARY $ CACHE INTERNAL "") +set(ZLIB_LIBRARY $ CACHE INTERNAL FORCE "") set(ZLIB_LIBRARIES ZLIB::ZLIB CACHE INTERNAL "") if(DEFINED ZLIB_LIBRARY_DEBUG)