Skip to content

Commit c9fd0db

Browse files
authored
[CMake] Pass ZLIB_LIBRARY_* to runtimes bootstrap (llvm#191555)
Runtimes external project (compiler-rt / combined runtimes) reconfigures with an initial cache that did not propagate `ZLIB_LIBRARY_RELEASE`. CMake 4.x `FindZLIB` may leave `ZLIB_LIBRARY` unset while finding headers, leading to: ``` -- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "...") ``` and later when loading LLVM exports from the main build: ``` The link interface of target "LLVMSupport" contains: ZLIB::ZLIB but the target was not found. ``` This was found by building the Windows installer with: ``` llvm\utils\release\build_llvm_release.bat --x64 --version 23.0.0 --skip-checkout --local-python ```
1 parent f09850a commit c9fd0db

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

llvm/cmake/modules/LLVMExternalProjectUtils.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ function(llvm_ExternalProject_Add name source_dir)
179179
LibEdit_LIBRARIES
180180
ZLIB_INCLUDE_DIR
181181
ZLIB_LIBRARY
182+
ZLIB_LIBRARY_RELEASE
183+
ZLIB_LIBRARY_DEBUG
182184
zstd_INCLUDE_DIR
183185
zstd_LIBRARY
184186
LIBXML2_LIBRARY

llvm/utils/release/build_llvm_release.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ set cmake_flags=^
246246
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib ^
247247
-DZLIB_INCLUDE_DIR=%zlibdir%/include ^
248248
-DZLIB_LIBRARY=%zlibdir%/lib/zs.lib ^
249+
-DZLIB_LIBRARY_RELEASE=%zlibdir%/lib/zs.lib ^
249250
-Dzstd_INCLUDE_DIR=%zstddir%/include ^
250251
-Dzstd_LIBRARY=%zstddir%/lib/zstd_static.lib
251252

@@ -312,6 +313,7 @@ set cmake_flags=^
312313
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib ^
313314
-DZLIB_INCLUDE_DIR=%zlibdir%/include ^
314315
-DZLIB_LIBRARY=%zlibdir%/lib/zs.lib ^
316+
-DZLIB_LIBRARY_RELEASE=%zlibdir%/lib/zs.lib ^
315317
-Dzstd_INCLUDE_DIR=%zstddir%/include ^
316318
-Dzstd_LIBRARY=%zstddir%/lib/zstd_static.lib ^
317319
-DCLANG_DEFAULT_LINKER=lld

0 commit comments

Comments
 (0)