-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Petr Shumilov <[email protected]>
- Loading branch information
1 parent
1fc7f06
commit fe56929
Showing
18 changed files
with
159 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,9 @@ jobs: | |
- name: Setup Environment | ||
run: | | ||
echo "-------------" | ||
xcrun --sdk macosx --show-sdk-path | ||
echo $(xcrun --sdk macosx --show-sdk-path) | ||
brew tap shivammathur/php | ||
brew update | ||
brew install [email protected] re2c cmake coreutils libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
#pragma once | ||
|
||
#include <zlib.h> | ||
#include "zlib/zlib.h" | ||
|
||
#include "common/wrappers/string_view.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule zlib
updated
86 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
set(ZLIB_NO_PIC_BUILD_DIR ${CMAKE_BINARY_DIR}/third-party/zlib-no-pic/build) | ||
set(ZLIB_NO_PIC_INSTALL_DIR ${CMAKE_BINARY_DIR}/third-party/zlib-no-pic/install) | ||
# Ensure the build and installation directories exists | ||
file(MAKE_DIRECTORY ${ZLIB_NO_PIC_BUILD_DIR}) | ||
file(MAKE_DIRECTORY ${ZLIB_NO_PIC_INSTALL_DIR}) | ||
|
||
# For further optional differences | ||
if(COMPILE_RUNTIME_LIGHT) | ||
set(ZLIB_NO_PIC_COMPILE_FLAGS "${ZLIB_COMMON_COMPILE_FLAGS} -fno-pic -static") | ||
else () | ||
set(ZLIB_NO_PIC_COMPILE_FLAGS "${ZLIB_COMMON_COMPILE_FLAGS} -fno-pic -static") | ||
endif() | ||
|
||
ExternalProject_Add( | ||
zlib-no-pic | ||
PREFIX ${ZLIB_NO_PIC_BUILD_DIR} | ||
SOURCE_DIR ${ZLIB_SOURCE_DIR} | ||
INSTALL_DIR ${ZLIB_NO_PIC_INSTALL_DIR} | ||
BINARY_DIR ${ZLIB_NO_PIC_BUILD_DIR} | ||
BUILD_BYPRODUCTS ${ZLIB_NO_PIC_INSTALL_DIR}/lib/libz-no-pic.a | ||
CONFIGURE_COMMAND | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ZLIB_SOURCE_DIR} ${ZLIB_NO_PIC_BUILD_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CFLAGS=${ZLIB_NO_PIC_COMPILE_FLAGS} ./configure --prefix=${ZLIB_NO_PIC_INSTALL_DIR} --includedir=${ZLIB_INCLUDE_DIRS}/zlib --static | ||
BUILD_COMMAND | ||
COMMAND make libz.a -j | ||
INSTALL_COMMAND | ||
COMMAND make install | ||
COMMAND ${CMAKE_COMMAND} -E rename ${ZLIB_NO_PIC_INSTALL_DIR}/lib/libz.a ${ZLIB_NO_PIC_INSTALL_DIR}/lib/libz-no-pic.a | ||
COMMAND ${CMAKE_COMMAND} -E copy ${ZLIB_NO_PIC_INSTALL_DIR}/lib/libz-no-pic.a ${LIB_DIR} | ||
BUILD_IN_SOURCE 0 | ||
) | ||
|
||
set(ZLIB_NO_PIC_LIBRARIES ${ZLIB_NO_PIC_INSTALL_DIR}/lib/libz-no-pic.a) | ||
|
||
add_library(ZLIB::ZLIB_NO_PIC STATIC IMPORTED) | ||
set_target_properties(ZLIB::ZLIB_NO_PIC PROPERTIES | ||
IMPORTED_LOCATION ${ZLIB_NO_PIC_LIBRARIES} | ||
INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS} | ||
) | ||
|
||
# Ensure that the zlib are built before they are used | ||
add_dependencies(ZLIB::ZLIB_NO_PIC zlib-no-pic) | ||
|
||
# Set variables indicating that zlib has been installed | ||
set(ZLIB_NO_PIC_ROOT ${ZLIB_NO_PIC_INSTALL_DIR}) | ||
|
||
cmake_print_variables(ZLIB_NO_PIC_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
set(ZLIB_PIC_BUILD_DIR ${CMAKE_BINARY_DIR}/third-party/zlib-pic/build) | ||
set(ZLIB_PIC_INSTALL_DIR ${CMAKE_BINARY_DIR}/third-party/zlib-pic/install) | ||
# Ensure the build and installation directories exists | ||
file(MAKE_DIRECTORY ${ZLIB_PIC_BUILD_DIR}) | ||
file(MAKE_DIRECTORY ${ZLIB_PIC_INSTALL_DIR}) | ||
|
||
# For further optional differences | ||
if(COMPILE_RUNTIME_LIGHT) | ||
set(ZLIB_PIC_COMPILE_FLAGS "${ZLIB_COMMON_COMPILE_FLAGS} -fPIC") | ||
else() | ||
set(ZLIB_PIC_COMPILE_FLAGS "${ZLIB_COMMON_COMPILE_FLAGS} -fPIC") | ||
endif() | ||
|
||
ExternalProject_Add( | ||
zlib-pic | ||
PREFIX ${ZLIB_PIC_BUILD_DIR} | ||
SOURCE_DIR ${ZLIB_SOURCE_DIR} | ||
INSTALL_DIR ${ZLIB_PIC_INSTALL_DIR} | ||
BINARY_DIR ${ZLIB_PIC_BUILD_DIR} | ||
BUILD_BYPRODUCTS ${ZLIB_PIC_INSTALL_DIR}/lib/libz-pic.a | ||
CONFIGURE_COMMAND | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ZLIB_SOURCE_DIR} ${ZLIB_PIC_BUILD_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CFLAGS=${ZLIB_PIC_COMPILE_FLAGS} ./configure --prefix=${ZLIB_PIC_INSTALL_DIR} --includedir=${ZLIB_INCLUDE_DIRS}/zlib --static | ||
BUILD_COMMAND | ||
COMMAND make libz.a -j | ||
INSTALL_COMMAND | ||
COMMAND make install | ||
COMMAND ${CMAKE_COMMAND} -E rename ${ZLIB_PIC_INSTALL_DIR}/lib/libz.a ${ZLIB_PIC_INSTALL_DIR}/lib/libz-pic.a | ||
COMMAND ${CMAKE_COMMAND} -E copy ${ZLIB_PIC_INSTALL_DIR}/lib/libz-pic.a ${LIB_DIR} | ||
BUILD_IN_SOURCE 0 | ||
) | ||
|
||
set(ZLIB_PIC_LIBRARIES ${ZLIB_PIC_INSTALL_DIR}/lib/libz-pic.a) | ||
|
||
add_library(ZLIB::ZLIB_PIC STATIC IMPORTED) | ||
set_target_properties(ZLIB::ZLIB_PIC PROPERTIES | ||
IMPORTED_LOCATION ${ZLIB_PIC_LIBRARIES} | ||
INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS} | ||
) | ||
|
||
# Ensure that the zlib are built before they are used | ||
add_dependencies(ZLIB::ZLIB_PIC zlib-pic) | ||
|
||
# Set variables indicating that zlib has been installed | ||
set(ZLIB_PIC_ROOT ${ZLIB_PIC_INSTALL_DIR}) | ||
|
||
cmake_print_variables(ZLIB_PIC_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
if(COMPILE_RUNTIME_LIGHT) | ||
set(ZLIB_BUILD_EXAMPLES OFF BOOL "Disable ZLIB_BUILD_EXAMPLES") | ||
set(ZLIB_COMPILE_FLAGS "-O3" "-fPIC") | ||
update_git_submodule(${THIRD_PARTY_DIR}/zlib "--recursive") | ||
|
||
set(RENAME_ZCONF OFF) | ||
add_subdirectory(${THIRD_PARTY_DIR}/zlib ${CMAKE_BINARY_DIR}/third-party/zlib) | ||
set(ZLIB_SOURCE_DIR ${THIRD_PARTY_DIR}/zlib) | ||
set(ZLIB_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/third-party/zlib/install/include) | ||
# Ensure the include directory exists | ||
file(MAKE_DIRECTORY ${ZLIB_INCLUDE_DIRS}) | ||
|
||
target_compile_definitions(zlibstatic PRIVATE Z_HAVE_UNISTD_H) | ||
target_compile_definitions(zlib PRIVATE Z_HAVE_UNISTD_H) | ||
target_compile_options(zlibstatic PUBLIC ${ZLIB_COMPILE_FLAGS}) | ||
# The configuration has been based on: | ||
# https://sources.debian.org/src/zlib/1%3A1.3.dfsg%2Breally1.3.1-1/debian/rules/#L20 | ||
set(ZLIB_COMMON_COMPILE_FLAGS "$ENV{CFLAGS} -g0 -Wall -O3 -D_REENTRANT -DZ_HAVE_UNISTD_H") | ||
|
||
# Set output directories for zlib targets | ||
set(ZLIB_LIB_DIR "${OBJS_DIR}/lib") | ||
set_target_properties(zlibstatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY | ||
${ZLIB_LIB_DIR}) | ||
if(APPLE) | ||
set(ZLIB_COMMON_COMPILE_FLAGS "${ZLIB_COMMON_COMPILE_FLAGS} -DZ_HAVE_UNISTD_H -I/usr/include") | ||
endif() | ||
|
||
include(${THIRD_PARTY_DIR}/zlib-cmake/zlib-pic.cmake) | ||
include(${THIRD_PARTY_DIR}/zlib-cmake/zlib-no-pic.cmake) | ||
|
||
add_custom_command( | ||
TARGET zlib-no-pic zlib-pic POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ZLIB_INCLUDE_DIRS} ${INCLUDE_DIR} | ||
BYPRODUCTS ${INCLUDE_DIR}/zlib | ||
) | ||
|
||
set(ZLIB_FOUND ON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters