Kaynağa Gözat

Updates the zlib package to only build statically (#34)

* Updates the zlib package to only build statically
Also makes it so that the zlib package has a FindZLIB.cmake in its subfolder that is compatible with use in non-o3de compiles.

Signed-off-by: lawsonamzn <[email protected]>
Nicholas Lawson 4 yıl önce
ebeveyn
işleme
6cc71bb26e

+ 31 - 0
package-system/zlib/FindZLIB_compat_unixlike.cmake

@@ -0,0 +1,31 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+# this file is provided to give compatibility to non-o3de-projects
+# it defines the same targets as is defined in the default FindZLIB.cmake
+# shipped with CMAKE.
+# Its meant to be deployed into the zlib subfolder of the package
+# and then allows you set the variable ZLIB_ROOT on the command line to point at this folder,
+# to force it to use this package instead of system ZLIB. 
+
+set(ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/include)
+set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
+set(ZLIB_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/lib/libz.a)
+set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
+set(ZLIB_FOUND True)
+set(ZLIB_VERSION_STRING "1.2.11")
+set(ZLIB_VERSION_MAJOR "1")
+set(ZLIB_VERSION_MINOR "2")
+set(ZLIB_VERSION_PATCH "11")
+set(ZLIB_MAJOR_VERSION "1")
+set(ZLIB_MINOR_VERSION "2")
+set(ZLIB_PATCH_VERSION "11")
+
+add_library(ZLIB::ZLIB INTERFACE IMPORTED GLOBAL)
+set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+target_link_libraries(ZLIB::ZLIB INTERFACE ${ZLIB_LIBRARIES})

+ 31 - 0
package-system/zlib/FindZLIB_compat_windows.cmake

@@ -0,0 +1,31 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+# this file is provided to give compatibility to non-o3de-projects
+# it defines the same targets as is defined in the default FindZLIB.cmake
+# shipped with CMAKE.
+# Its meant to be deployed into the zlib subfolder of the package
+# and then allows you set the variable ZLIB_ROOT on the command line to point at this folder,
+# to force it to use this package instead of system ZLIB.
+
+set(ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/include)
+set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
+set(ZLIB_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/lib/zlibstatic.lib)
+set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
+set(ZLIB_FOUND True)
+set(ZLIB_VERSION_STRING "1.2.11")
+set(ZLIB_VERSION_MAJOR "1")
+set(ZLIB_VERSION_MINOR "2")
+set(ZLIB_VERSION_PATCH "11")
+set(ZLIB_MAJOR_VERSION "1")
+set(ZLIB_MINOR_VERSION "2")
+set(ZLIB_PATCH_VERSION "11")
+
+add_library(ZLIB::ZLIB INTERFACE IMPORTED GLOBAL)
+set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+target_link_libraries(ZLIB::ZLIB INTERFACE ${ZLIB_LIBRARIES})

+ 44 - 0
package-system/zlib/Findzlib.cmake

@@ -0,0 +1,44 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+# this file actually ingests the library and defines targets.
+set(TARGET_WITH_NAMESPACE "3rdParty::zlib")
+if (TARGET ${TARGET_WITH_NAMESPACE})
+    return()
+endif()
+
+set(zlib_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/zlib/include)
+set(zlib_LIBS_DIR ${CMAKE_CURRENT_LIST_DIR}/zlib/lib)
+
+if (${PAL_PLATFORM_NAME} STREQUAL "Linux")
+    set(zlib_LIBRARY_DEBUG   ${zlib_LIBS_DIR}/libz.a)
+    set(zlib_LIBRARY_RELEASE ${zlib_LIBS_DIR}/libz.a)
+elseif(${PAL_PLATFORM_NAME} STREQUAL "Android")
+    set(zlib_LIBRARY_DEBUG   ${zlib_LIBS_DIR}/libz.a)
+    set(zlib_LIBRARY_RELEASE ${zlib_LIBS_DIR}/libz.a)
+elseif(${PAL_PLATFORM_NAME} STREQUAL "Windows")
+    set(zlib_LIBRARY_DEBUG   ${zlib_LIBS_DIR}/zlibstaticd.lib)
+    set(zlib_LIBRARY_RELEASE ${zlib_LIBS_DIR}/zlibstatic.lib)
+elseif(${PAL_PLATFORM_NAME} STREQUAL "Mac")
+    set(zlib_LIBRARY_DEBUG   ${zlib_LIBS_DIR}/libz.a)
+    set(zlib_LIBRARY_RELEASE ${zlib_LIBS_DIR}/libz.a)
+elseif(${PAL_PLATFORM_NAME} STREQUAL "iOS")
+    set(zlib_LIBRARY_DEBUG   ${zlib_LIBS_DIR}/libz.a)
+    set(zlib_LIBRARY_RELEASE ${zlib_LIBS_DIR}/libz.a)
+endif()
+
+# we set it to a generator expression for multi-config situations:
+set(zlib_LIBRARY                  "$<$<CONFIG:profile>:${zlib_LIBRARY_RELEASE}>")
+set(zlib_LIBRARY ${zlib_LIBRARY} "$<$<CONFIG:Release>:${zlib_LIBRARY_RELEASE}>")
+set(zlib_LIBRARY ${zlib_LIBRARY} "$<$<CONFIG:Debug>:${zlib_LIBRARY_DEBUG}>")
+
+add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${zlib_INCLUDE_DIR})
+target_link_libraries(${TARGET_WITH_NAMESPACE} INTERFACE ${zlib_LIBRARY})
+
+set(zlib_FOUND True)

+ 0 - 44
package-system/zlib/Findzlib.cmake.template

@@ -1,44 +0,0 @@
-#
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-# 
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-#
-
-# this file actually ingests the library and defines targets.
-set(TARGET_WITH_NAMESPACE "3rdParty::zlib")
-if (TARGET $${TARGET_WITH_NAMESPACE})
-    return()
-endif()
-
-set(zlib_INCLUDE_DIR $${CMAKE_CURRENT_LIST_DIR}/zlib/include)
-set(zlib_LIBS_DIR $${CMAKE_CURRENT_LIST_DIR}/zlib/lib)
-
-if ($${PAL_PLATFORM_NAME} STREQUAL "Linux")
-    set(zlib_LIBRARY_DEBUG   $${zlib_LIBS_DIR}/libz.a)
-    set(zlib_LIBRARY_RELEASE $${zlib_LIBS_DIR}/libz.a)
-elseif($${PAL_PLATFORM_NAME} STREQUAL "Android")
-    set(zlib_LIBRARY_DEBUG   $${zlib_LIBS_DIR}/libz.a)
-    set(zlib_LIBRARY_RELEASE $${zlib_LIBS_DIR}/libz.a)
-elseif($${PAL_PLATFORM_NAME} STREQUAL "Windows")
-    set(zlib_LIBRARY_DEBUG   $${zlib_LIBS_DIR}/zlibstaticd.lib)
-    set(zlib_LIBRARY_RELEASE $${zlib_LIBS_DIR}/zlibstatic.lib)
-elseif($${PAL_PLATFORM_NAME} STREQUAL "Mac")
-    set(zlib_LIBRARY_DEBUG   $${zlib_LIBS_DIR}/libz.a)
-    set(zlib_LIBRARY_RELEASE $${zlib_LIBS_DIR}/libz.a)
-elseif($${PAL_PLATFORM_NAME} STREQUAL "iOS")
-    set(zlib_LIBRARY_DEBUG   $${zlib_LIBS_DIR}/libz.a)
-    set(zlib_LIBRARY_RELEASE $${zlib_LIBS_DIR}/libz.a)
-endif()
-
-# we set it to a generator expression for multi-config situations:
-set(zlib_LIBRARY                  "$$<$$<CONFIG:profile>:$${zlib_LIBRARY_RELEASE}>")
-set(zlib_LIBRARY $${zlib_LIBRARY} "$$<$$<CONFIG:Release>:$${zlib_LIBRARY_RELEASE}>")
-set(zlib_LIBRARY $${zlib_LIBRARY} "$$<$$<CONFIG:Debug>:$${zlib_LIBRARY_DEBUG}>")
-
-add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
-ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE} INTERFACE $${zlib_INCLUDE_DIR})
-target_link_libraries($${TARGET_WITH_NAMESPACE} INTERFACE $${zlib_LIBRARY})
-
-set(zlib_FOUND True)

+ 21 - 43
package-system/zlib/build_config.json

@@ -3,83 +3,61 @@
     "git_tag":"v1.2.11",
     "git_commit":"cacf7f1d4e3d44d871b605da3b647f07d718623f",
     "package_name":"zlib",
-    "package_version":"1.2.11-rev1",
+    "package_version":"1.2.11-rev2",
     "package_url":"https://zlib.net",
     "package_license":"Zlib",
     "additional_src_files":[
       "LICENSE"
     ],
     "package_license_file":"LICENSE",
-    "cmake_find_template":"Findzlib.cmake.template",
+    "cmake_find_source":"Findzlib.cmake",
     "cmake_find_target":"Findzlib.cmake",
     "cmake_build_args" : [ "-j", "8"],
     "Platforms":{
         "Windows":{
             "Windows":{
-                "custom_cmake_install":true,
-                "cmake_generate_args_debug":[
-                    "-DCMAKE_CXX_STANDARD=17",
-                    "-DCMAKE_DEBUG_POSTFIX=d",
-                    "-DSKIP_INSTALL_FILES=YES"
+                "custom_build_cmd" : [
+                    "build_zlib_windows.cmd"
                 ],
-                "cmake_generate_args_release":[
-                    "-DCMAKE_CXX_STANDARD=17",
-                    "-DSKIP_INSTALL_FILES=YES"
+                "custom_install_cmd": [
+                    "install_zlib_windows.cmd"
                 ]
             },
             "Android":{
-                "custom_cmake_install":true,
-                "build_configs":[
-                    "Release"
+                "custom_build_cmd" : [
+                    "build_zlib_android.cmd"
                 ],
-                "cmake_generate_args_release":[
-                   "-G",
-                   "Ninja",
-                   "-DCMAKE_TOOLCHAIN_FILE=%LY_ANDROID_NDK_ROOT%\\build\\cmake\\android.toolchain.cmake",
-                   "-DANDROID_ABI=arm64-v8a",
-                   "-DCMAKE_CXX_FLAGS=\"-fPIC\"",
-                   "-DCMAKE_CXX_STANDARD=17",
-                   "-DCMAKE_BUILD_TYPE=Release"
+                "custom_install_cmd": [
+                    "install_zlib_android.cmd"
                 ]
             }
         },
         
         "Darwin":{
             "Mac":{
-                "custom_cmake_install":true,
-                "cmake_generate_args_release":[
-                    "-DCMAKE_CXX_STANDARD=17",
-                    "-DCMAKE_BUILD_TYPE=Release",
-                    "-DSKIP_INSTALL_FILES=YES"
-                ],
-                "build_configs":[
-                    "Release"
-                ]
+                "custom_build_cmd": [
+                    "./build_zlib_mac.sh"
+                 ],
+                 "custom_install_cmd": [
+                    "./install_zlib_mac.sh"
+                 ]
             },
             "iOS":{
-                "custom_cmake_install":true,
                 "custom_build_cmd": [
                     "./build_zlib_ios.sh"
                  ],
                  "custom_install_cmd": [
                     "./install_zlib_ios.sh"
-                 ],
-                "build_configs":[
-                    "Release"
-                ]
+                 ]
              }
         },
         "Linux":{
             "Linux":{
-                "custom_cmake_install":true,
-                "cmake_generate_args_release":[
-                    "-DCMAKE_CXX_STANDARD=17",
-                    "-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
-                    "-DCMAKE_BUILD_TYPE=Release",
-                    "-DSKIP_INSTALL_FILES=YES"
+                "custom_build_cmd": [
+                    "./build_zlib_linux.sh"
                 ],
-                "build_configs":[
-                    "Release"
+                "custom_install_cmd": [
+                    "./install_zlib_linux.sh"
                 ]
             }
         }

+ 18 - 0
package-system/zlib/build_zlib_android.cmd

@@ -0,0 +1,18 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+
+@IF "%LY_ANDROID_NDK_ROOT%" == "" (
+    @echo Need to set the varible LY_ANDROID_NDK_ROOT to the location of your NDK install!
+    @exit /b 1
+)
+
+cmake -S temp/src -B temp/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_STANDARD=17 -DCMAKE_TOOLCHAIN_FILE=%LY_ANDROID_NDK_ROOT%\\build\\cmake\\android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_SHARED_LIBS=OFF -DSKIP_INSTALL_FILES=YES
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+cmake --build temp/build --target zlibstatic -j 8
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+
+exit /b 0

+ 10 - 1
package-system/zlib/build_zlib_ios.sh

@@ -9,5 +9,14 @@
 # The CMakeLists.txt included with zlib unconditionally makes all the dylibs AND also
 # makes "appplication" executables.  This is not great for making a sdk for ios.
 # this custom script just runs it building the static lib only:
-cmake -S temp/src -B temp/build -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_CXX_STANDARD=17 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_CXX_FLAGS="-fPIC" -DSKIP_INSTALL_FILES=YES
+cmake -S temp/src -B temp/build -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_CXX_STANDARD=17 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_C_FLAGS="-fPIC" -DSKIP_INSTALL_FILES=YES
+if [ $? -ne 0 ]; then
+    echo "Error generating build"
+    exit 1
+fi
+
 cmake --build temp/build --target zlibstatic --config Release -j 8
+if [ $? -ne 0 ]; then
+    echo "Error building"
+    exit 1
+fi

+ 19 - 0
package-system/zlib/build_zlib_linux.sh

@@ -0,0 +1,19 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+cmake -S temp/src -B temp/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_C_FLAGS=-fPIC -DSKIP_INSTALL_FILES=YES
+if [ $? -ne 0 ]; then
+    echo "Error generating build"
+    exit 1
+fi
+
+cmake --build temp/build --target zlibstatic -j 8
+if [ $? -ne 0 ]; then
+    echo "Error building"
+    exit 1
+fi

+ 20 - 0
package-system/zlib/build_zlib_mac.sh

@@ -0,0 +1,20 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+cmake -S temp/src -B temp/build -G Xcode -DCMAKE_CXX_STANDARD=17 -DSKIP_INSTALL_FILES=YES
+if [ $? -ne 0 ]; then
+    echo "Error generating build"
+    exit 1
+fi
+
+cmake --build temp/build --target zlibstatic --config Release -j 8
+if [ $? -ne 0 ]; then
+    echo "Error building"
+    exit 1
+fi
+

+ 15 - 0
package-system/zlib/build_zlib_windows.cmd

@@ -0,0 +1,15 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+
+cmake -S temp/src -B temp/build  -DCMAKE_CXX_STANDARD=17 -DCMAKE_DEBUG_POSTFIX=d -DBUILD_SHARED_LIBS=OFF -DSKIP_INSTALL_FILES=YES
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+cmake --build temp/build --target zlibstatic --config Release -j 8
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+cmake --build temp/build --target zlibstatic --config Debug -j 8
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+
+exit /b 0

+ 28 - 0
package-system/zlib/install_zlib_android.cmd

@@ -0,0 +1,28 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+@rem #
+@setlocal
+
+set OUT_PATH=%TARGET_INSTALL_ROOT%
+set SRC_PATH=temp\src
+set BLD_PATH=temp\build
+
+mkdir %OUT_PATH%\include
+mkdir %OUT_PATH%\lib
+
+copy %BLD_PATH%\zconf.h %OUT_PATH%\include\zconf.h
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %SRC_PATH%\zlib.h %OUT_PATH%\include\zlib.h
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %SRC_PATH%\LICENSE %OUT_PATH%\LICENSE
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %BLD_PATH%\libz.a %OUT_PATH%\lib\libz.a
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy FindZLIB_compat_unixlike.cmake %OUT_PATH%\FindZLIB.cmake
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+
+exit /b 0

+ 8 - 5
package-system/zlib/install_zlib_ios.sh

@@ -10,14 +10,17 @@ OUT_PATH=$TARGET_INSTALL_ROOT
 SRC_PATH=temp/src
 BLD_PATH=temp/build
 
-mkdir -p $OUT_PATH
+# these can fail if they are already there and we're working incrementally, this is okay
+# if they fail completely, the below checks will error anyway
 
-cp -f $SRC_PATH/LICENSE $OUT_PATH/
+mkdir -p $OUT_PATH
 mkdir -p $OUT_PATH/lib
 mkdir -p $OUT_PATH/include
 
-cp $BLD_PATH/Release-iphoneos/libz.a $OUT_PATH/lib/libz.a
-cp $BLD_PATH/zconf.h $OUT_PATH/include/zconf.h
-cp $SRC_PATH/zlib.h $OUT_PATH/include/zlib.h
+cp -f $SRC_PATH/LICENSE $OUT_PATH/ || exit 1
+cp $BLD_PATH/Release-iphoneos/libz.a $OUT_PATH/lib/libz.a || exit 1
+cp $BLD_PATH/zconf.h $OUT_PATH/include/zconf.h || exit 1
+cp $SRC_PATH/zlib.h $OUT_PATH/include/zlib.h || exit 1
+cp FindZLIB_compat_unixlike.cmake $OUT_PATH/FindZLIB.cmake || exit 1
 
 exit 0

+ 25 - 0
package-system/zlib/install_zlib_linux.sh

@@ -0,0 +1,25 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+OUT_PATH=$TARGET_INSTALL_ROOT
+SRC_PATH=temp/src
+BLD_PATH=temp/build
+
+# these can fail if they are already there and we're working incrementally, this is okay
+# if they fail completely, the below checks will error anyway
+mkdir -p $OUT_PATH
+mkdir -p $OUT_PATH/lib
+mkdir -p $OUT_PATH/include
+
+cp -f $SRC_PATH/LICENSE $OUT_PATH/ || exit 1
+cp $BLD_PATH/libz.a $OUT_PATH/lib/libz.a || exit 1
+cp $BLD_PATH/zconf.h $OUT_PATH/include/zconf.h || exit 1
+cp $SRC_PATH/zlib.h $OUT_PATH/include/zlib.h || exit 1
+cp FindZLIB_compat_unixlike.cmake $OUT_PATH/FindZLIB.cmake || exit 1
+
+exit 0

+ 25 - 0
package-system/zlib/install_zlib_mac.sh

@@ -0,0 +1,25 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+OUT_PATH=$TARGET_INSTALL_ROOT
+SRC_PATH=temp/src
+BLD_PATH=temp/build
+
+# these can fail if they are already there and we're working incrementally, this is okay
+# if they fail completely, the below checks will error anyway
+mkdir -p $OUT_PATH
+mkdir -p $OUT_PATH/lib
+mkdir -p $OUT_PATH/include
+
+cp -f $SRC_PATH/LICENSE $OUT_PATH/ || exit 1
+cp $BLD_PATH/Release/libz.a $OUT_PATH/lib/libz.a || exit 1
+cp $BLD_PATH/zconf.h $OUT_PATH/include/zconf.h || exit 1
+cp $SRC_PATH/zlib.h $OUT_PATH/include/zlib.h || exit 1
+cp FindZLIB_compat_unixlike.cmake $OUT_PATH/FindZLIB.cmake || exit 1
+
+exit 0

+ 32 - 0
package-system/zlib/install_zlib_windows.cmd

@@ -0,0 +1,32 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+@rem #
+@setlocal
+
+set OUT_PATH=%TARGET_INSTALL_ROOT%
+set SRC_PATH=temp\src
+set BLD_PATH=temp\build
+
+mkdir %OUT_PATH%\include
+mkdir %OUT_PATH%\lib
+
+copy %BLD_PATH%\zconf.h %OUT_PATH%\include\zconf.h
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %SRC_PATH%\zlib.h %OUT_PATH%\include\zlib.h
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %SRC_PATH%\LICENSE %OUT_PATH%\LICENSE
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %BLD_PATH%\Release\zlibstatic.lib %OUT_PATH%\lib\zlibstatic.lib
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %BLD_PATH%\Debug\zlibstaticd.lib %OUT_PATH%\lib\zlibstaticd.lib
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy %BLD_PATH%\Debug\zlibstaticd.pdb %OUT_PATH%\lib\zlibstaticd.pdb
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+copy FindZLIB_compat_windows.cmake %OUT_PATH%\FindZLIB.cmake
+@if %errorlevel% NEQ 0 ( exit /b 1 )
+
+exit /b 0

+ 4 - 4
package_build_list_host_darwin.json

@@ -38,8 +38,8 @@
         "mcpp-2.7.2_az.1-rev1-mac": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.1-rev1",
         "mikkelsen-1.0.0.4-mac": "package-system/mikkelsen/build_package_image.py --platform mac",
         "mikkelsen-1.0.0.4-ios": "package-system/mikkelsen/build_package_image.py --platform ios",
-        "zlib-1.2.11-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Mac --package-root ../../package-system --clean",
-        "zlib-1.2.11-rev1-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name iOS --package-root ../../package-system --clean"
+        "zlib-1.2.11-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Mac --package-root ../../package-system --clean",
+        "zlib-1.2.11-rev2-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name iOS --package-root ../../package-system --clean"
     },
     "build_from_folder": {
         "AWSNativeSDK-1.7.167-rev5-mac": "package-system/AWSNativeSDK-mac",
@@ -81,7 +81,7 @@
         "SQLite-3.32.2-rev3-multiplatform": "package-system/SQLite-multiplatform",
         "xxhash-0.7.4-rev1-multiplatform": "package-system/xxhash-multiplatform",
         "qt-5.15.2-rev5-mac": "package-system/qt-mac",
-        "zlib-1.2.11-rev1-mac": "package-system/zlib-mac",
-        "zlib-1.2.11-rev1-ios": "package-system/zlib-ios"
+        "zlib-1.2.11-rev2-mac": "package-system/zlib-mac",
+        "zlib-1.2.11-rev2-ios": "package-system/zlib-ios"
     }
 }

+ 2 - 2
package_build_list_host_linux.json

@@ -27,7 +27,7 @@
         "tiff-4.2.0.10-linux": "package-system/tiff/build_package_image.py --platform linux",
         "python-3.7.10-rev2-linux": "package-system/python/build_package_image.py",
         "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py",
-        "zlib-1.2.11-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean"
+        "zlib-1.2.11-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean"
     },
     "build_from_folder" : {
         "AWSGameLiftServerSDK-3.4.1-rev1-linux": "package-system/AWSGameLiftServerSDK/linux",
@@ -58,6 +58,6 @@
         "SQLite-3.32.2-rev3-multiplatform": "package-system/SQLite-multiplatform",
         "xxhash-0.7.4-rev1-multiplatform": "package-system/xxhash-multiplatform",
         "qt-5.15.2-rev5-linux": "package-system/qt-linux",
-        "zlib-1.2.11-rev1-linux": "package-system/zlib-linux"
+        "zlib-1.2.11-rev2-linux": "package-system/zlib-linux"
     }
 }

+ 4 - 4
package_build_list_host_windows.json

@@ -40,8 +40,8 @@
         "python-3.7.10-rev1-windows" : "package-system/python/build_package_image.py",
         "mikkelsen-1.0.0.4-windows": "package-system/mikkelsen/build_package_image.py",
         "mikkelsen-1.0.0.4-android": "package-system/mikkelsen/build_package_image.py --platform android",
-        "zlib-1.2.11-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Windows --package-root ../../package-system --clean",
-        "zlib-1.2.11-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Android --package-root ../../package-system --clean"
+        "zlib-1.2.11-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Windows --package-root ../../package-system --clean",
+        "zlib-1.2.11-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Android --package-root ../../package-system --clean"
       },
   "build_from_folder": {
     "AWSGameLiftServerSDK-3.4.1-rev1-windows" : "package-system/AWSGameLiftServerSDK/windows",
@@ -106,7 +106,7 @@
     "ISPCTexComp-36b80aa-rev1-windows": "package-system/ISPCTexComp-windows",
     "qt-5.15.2-rev4-windows": "package-system/qt-windows",
     "Wwise-2021.1.0.7575-rev1-multiplatform": "package-system/Wwise-multiplatform",
-    "zlib-1.2.11-rev1-android": "package-system/zlib-android",
-    "zlib-1.2.11-rev1-windows": "package-system/zlib-windows"
+    "zlib-1.2.11-rev2-android": "package-system/zlib-android",
+    "zlib-1.2.11-rev2-windows": "package-system/zlib-windows"
   }
 }