early-access version 2853
This commit is contained in:
53
externals/vcpkg/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
vendored
Executable file
53
externals/vcpkg/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
vendored
Executable file
@@ -0,0 +1,53 @@
|
||||
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
|
||||
index a7f24cc..a1b359b 100644
|
||||
--- a/zconf.h.cmakein
|
||||
+++ b/zconf.h.cmakein
|
||||
@@ -434,11 +434,19 @@ typedef uLong FAR uLongf;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||
-# define Z_HAVE_UNISTD_H
|
||||
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
|
||||
+# define Z_HAVE_UNISTD_H
|
||||
+# elif HAVE_UNISTD_H != 0
|
||||
+# define Z_HAVE_UNISTD_H
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||
-# define Z_HAVE_STDARG_H
|
||||
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
|
||||
+# define Z_HAVE_STDARG_H
|
||||
+# elif HAVE_STDARG_H != 0
|
||||
+# define Z_HAVE_STDARG_H
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#ifdef STDC
|
||||
diff --git a/zconf.h.in b/zconf.h.in
|
||||
index 5e1d68a..32f53c8 100644
|
||||
--- a/zconf.h.in
|
||||
+++ b/zconf.h.in
|
||||
@@ -432,11 +432,19 @@ typedef uLong FAR uLongf;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||
-# define Z_HAVE_UNISTD_H
|
||||
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
|
||||
+# define Z_HAVE_UNISTD_H
|
||||
+# elif HAVE_UNISTD_H != 0
|
||||
+# define Z_HAVE_UNISTD_H
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||
-# define Z_HAVE_STDARG_H
|
||||
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
|
||||
+# define Z_HAVE_STDARG_H
|
||||
+# elif HAVE_STDARG_H != 0
|
||||
+# define Z_HAVE_STDARG_H
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#ifdef STDC
|
||||
|
||||
21
externals/vcpkg/ports/zlib/0002-android-build-mingw.patch
vendored
Executable file
21
externals/vcpkg/ports/zlib/0002-android-build-mingw.patch
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt (date 1618364429263)
|
||||
+++ b/CMakeLists.txt (date 1618364429263)
|
||||
@@ -170,7 +170,7 @@
|
||||
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
|
||||
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
|
||||
|
||||
-if(MINGW)
|
||||
+if(MINGW AND NOT ANDROID)
|
||||
# This gets us DLL resource information when compiling on MinGW.
|
||||
if(NOT CMAKE_RC_COMPILER)
|
||||
set(CMAKE_RC_COMPILER windres.exe)
|
||||
@@ -186,7 +186,7 @@
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
endif()
|
||||
-endif(MINGW)
|
||||
+endif(MINGW AND NOT ANDROID)
|
||||
|
||||
add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
74
externals/vcpkg/ports/zlib/cmake_dont_build_more_than_needed.patch
vendored
Executable file
74
externals/vcpkg/ports/zlib/cmake_dont_build_more_than_needed.patch
vendored
Executable file
@@ -0,0 +1,74 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0fe939d..a1291d5 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -7,6 +7,7 @@ set(VERSION "1.2.12")
|
||||
|
||||
option(ASM686 "Enable building i686 assembly implementation")
|
||||
option(AMD64 "Enable building amd64 assembly implementation")
|
||||
+option(SKIP_BUILD_EXAMPLES "Skip build of the examples" OFF)
|
||||
|
||||
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
|
||||
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
|
||||
@@ -124,9 +125,11 @@ set(ZLIB_SRCS
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
- set(ZLIB_DLL_SRCS
|
||||
- win32/zlib1.rc # If present will override custom build rule below.
|
||||
- )
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
+ set(ZLIB_DLL_SRCS
|
||||
+ win32/zlib1.rc # If present will override custom build rule below.
|
||||
+ )
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
@@ -180,11 +183,12 @@ if(MINGW)
|
||||
-I ${CMAKE_CURRENT_BINARY_DIR}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
|
||||
- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
+ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
+ endif()
|
||||
endif(MINGW)
|
||||
|
||||
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
set_target_properties(zlib PROPERTIES SOVERSION 1)
|
||||
|
||||
@@ -201,7 +205,7 @@ endif()
|
||||
|
||||
if(UNIX)
|
||||
# On unix-like platforms the library is almost always called libz
|
||||
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
|
||||
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
|
||||
if(NOT APPLE)
|
||||
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
|
||||
endif()
|
||||
@@ -211,7 +215,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
- install(TARGETS zlib zlibstatic
|
||||
+ install(TARGETS zlib
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
|
||||
@@ -230,6 +234,7 @@ endif()
|
||||
# Example binaries
|
||||
#============================================================================
|
||||
|
||||
+if (NOT SKIP_BUILD_EXAMPLES)
|
||||
add_executable(example test/example.c)
|
||||
target_link_libraries(example zlib)
|
||||
add_test(example example)
|
||||
@@ -247,3 +252,4 @@ if(HAVE_OFF64_T)
|
||||
target_link_libraries(minigzip64 zlib)
|
||||
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
|
||||
endif()
|
||||
+endif()
|
||||
13
externals/vcpkg/ports/zlib/debug-postfix-mingw.patch
vendored
Executable file
13
externals/vcpkg/ports/zlib/debug-postfix-mingw.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0fe939d..e4fc213 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -59,7 +59,7 @@ endif()
|
||||
#
|
||||
check_include_file(unistd.h Z_HAVE_UNISTD_H)
|
||||
|
||||
-if(MSVC)
|
||||
+if(WIN32)
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
47
externals/vcpkg/ports/zlib/portfile.cmake
vendored
Executable file
47
externals/vcpkg/ports/zlib/portfile.cmake
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO madler/zlib
|
||||
REF v1.2.12
|
||||
SHA512 5b029532a9f5f12ad425c12eccdf1b77c8d91801342c5b5e26ffb539f76a204e6c4882b40f0130f143f2cd38df90e90af2978cf4bb997e1fa3a0d1eff2ca979e
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
cmake_dont_build_more_than_needed.patch
|
||||
0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
|
||||
debug-postfix-mingw.patch
|
||||
0002-android-build-mingw.patch
|
||||
)
|
||||
|
||||
# This is generated during the cmake build
|
||||
file(REMOVE "${SOURCE_PATH}/zconf.h")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DSKIP_INSTALL_FILES=ON
|
||||
-DSKIP_BUILD_EXAMPLES=ON
|
||||
OPTIONS_DEBUG
|
||||
-DSKIP_INSTALL_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
# Install the pkgconfig file
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc" "-lz" "-lzlib")
|
||||
endif()
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc" "-lz" "-lzlibd")
|
||||
endif()
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
4
externals/vcpkg/ports/zlib/usage
vendored
Executable file
4
externals/vcpkg/ports/zlib/usage
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
The package zlib is compatible with built-in CMake targets:
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(main PRIVATE ZLIB::ZLIB)
|
||||
12
externals/vcpkg/ports/zlib/vcpkg-cmake-wrapper.cmake
vendored
Executable file
12
externals/vcpkg/ports/zlib/vcpkg-cmake-wrapper.cmake
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH)
|
||||
find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
|
||||
find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
|
||||
if(NOT ZLIB_INCLUDE_DIR OR NOT (ZLIB_LIBRARY_RELEASE OR ZLIB_LIBRARY_DEBUG))
|
||||
message(FATAL_ERROR "Broken installation of vcpkg port zlib")
|
||||
endif()
|
||||
if(CMAKE_VERSION VERSION_LESS 3.4)
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(ZLIB)
|
||||
unset(ZLIB_FOUND)
|
||||
endif()
|
||||
_find_package(${ARGS})
|
||||
14
externals/vcpkg/ports/zlib/vcpkg.json
vendored
Executable file
14
externals/vcpkg/ports/zlib/vcpkg.json
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "zlib",
|
||||
"version": "1.2.12",
|
||||
"port-version": 1,
|
||||
"description": "A compression library",
|
||||
"homepage": "https://www.zlib.net/",
|
||||
"license": "Zlib",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user