Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace zlib with zlib-ng #16100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Bun statically links these libraries:
| [`simdutf`](https://github.com/simdutf/simdutf) | Apache 2.0 |
| [`tinycc`](https://github.com/tinycc/tinycc) | LGPL v2.1 |
| [`uSockets`](https://github.com/uNetworking/uSockets) | Apache 2.0 |
| [`zlib-cloudflare`](https://github.com/cloudflare/zlib) | zlib |
| [`zlib-ng`](https://github.com/zlib-ng/zlib-ng) | zlib |
| [`c-ares`](https://github.com/c-ares/c-ares) | MIT licensed |
| [`libicu`](https://github.com/unicode-org/icu) 72 | [license here](https://github.com/unicode-org/icu/blob/main/icu4c/LICENSE) |
| [`libbase64`](https://github.com/aklomp/base64/blob/master/LICENSE) | BSD 2-Clause |
Expand Down
6 changes: 5 additions & 1 deletion cmake/Globals.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,11 @@ function(register_cmake_command)
if(include STREQUAL ".")
list(APPEND MAKE_EFFECTIVE_INCLUDES ${MAKE_CWD})
else()
list(APPEND MAKE_EFFECTIVE_INCLUDES ${MAKE_CWD}/${include})
if(IS_ABSOLUTE ${include})
list(APPEND MAKE_EFFECTIVE_INCLUDES ${include})
else()
list(APPEND MAKE_EFFECTIVE_INCLUDES ${MAKE_CWD}/${include})
endif()
endif()
endforeach()

Expand Down
2 changes: 1 addition & 1 deletion cmake/targets/BuildLibArchive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ register_cmake_command(
# spawn a processes to compress instead of using the library.
-DENABLE_ZLIB=OFF
-DHAVE_ZLIB_H=ON
-DCMAKE_C_FLAGS="-I${VENDOR_PATH}/zlib"
-DCMAKE_C_FLAGS="-I${BUILD_PATH}/zlib"
LIB_PATH
libarchive
LIBRARIES
Expand Down
19 changes: 7 additions & 12 deletions cmake/targets/BuildZlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ register_repository(
NAME
zlib
REPOSITORY
cloudflare/zlib
zlib-ng/zlib-ng
COMMIT
886098f3f339617b4243b286f5ed364b9989e245
860e4cff7917d93f54f5d7f0bc1d0e8b1a3cb988
)

# https://gitlab.kitware.com/cmake/cmake/-/issues/25755
if(APPLE)
set(ZLIB_CMAKE_C_FLAGS "-fno-define-target-os-macros")
set(ZLIB_CMAKE_CXX_FLAGS "-fno-define-target-os-macros")
endif()

if(WIN32)
if(DEBUG)
set(ZLIB_LIBRARY "zlibd")
Expand All @@ -30,11 +24,12 @@ register_cmake_command(
zlib
ARGS
-DBUILD_SHARED_LIBS=OFF
-DBUILD_EXAMPLES=OFF
"-DCMAKE_C_FLAGS=${ZLIB_CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS=${ZLIB_CMAKE_CXX_FLAGS}"
-DWITH_GTEST=OFF
-DZLIB_COMPAT=ON
-DZLIB_ENABLE_TESTS=OFF
-DZLIBNG_ENABLE_TESTS=OFF
LIBRARIES
${ZLIB_LIBRARY}
INCLUDES
.
${BUILD_PATH}/zlib
)
26 changes: 0 additions & 26 deletions patches/zlib/deflate.h.patch

This file was deleted.