Skip to content

Commit d786372

Browse files
authored
[ESI] Bump zlib tag (llvm#8963)
The latest zlib release (v1.3.1) is fairly old (Jan 22. 2024) and is missing some key changes/fixes for building w/ a static library. This seems to be somewhat system/cmake version dependent. In any case, solved by bumping to head of their development branch (still a 7 month old commit) which cleans up their CMake build system, and introduces an alias target for the static library.
1 parent d409ccd commit d786372

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/Dialect/ESI/runtime/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,20 @@ endif()
5959
# conflicts with local zlib versions, and since we don't export anything zlib
6060
# related in our public headers.
6161
message("-- pulling down zlib from git")
62-
set(ZLIB_USE_STATIC_LIBS ON)
63-
set(ZLIB_BUILD_EXAMPLES OFF)
62+
set(ZLIB_BUILD_SHARED OFF)
63+
set(ZLIB_BUILD_STATIC ON)
64+
set(ZLIB_BUILD_TESTING OFF)
6465
FetchContent_Declare(
6566
ZLIB
6667
GIT_REPOSITORY https://github.com/madler/zlib.git
67-
GIT_TAG v1.3.1
68+
# Note @mortbopet: The latest zlib release (v1.3.1) is fairly old (Jan 22. 2024)
69+
# and is missing some key changes/fixes for building w/ a static library.
70+
# For now, fixed by tagging to head of their development branch.
71+
# Change once a new release is made that includes these fixes.
72+
GIT_TAG 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71
6873
)
6974
FetchContent_MakeAvailable(ZLIB)
7075
set(ZLIB_INCLUDE_DIR ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
71-
set(ZLIB_LIBRARY zlibstatic)
7276
if(UNIX)
7377
target_compile_options(zlibstatic
7478
PRIVATE
@@ -181,7 +185,7 @@ if (DEFINED ZLIB_INCLUDE_DIR)
181185
endif()
182186

183187
target_link_libraries(ESICppRuntime PRIVATE
184-
${ZLIB_LIBRARY}
188+
ZLIB::ZLIBSTATIC
185189
nlohmann_json::nlohmann_json
186190
)
187191
target_link_libraries(ESICppRuntime PRIVATE

0 commit comments

Comments
 (0)