Commit f2de24c8 by Maarten L. Hekkelman

for CI: install zlib in windows

parent ed1eca8f
...@@ -25,7 +25,8 @@ jobs: ...@@ -25,7 +25,8 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, windows-latest] os: [ubuntu-latest, windows-latest]
build_type: [Release] build_type: [Release]
c_compiler: [gcc, clang, cl] # c_compiler: [gcc, clang, cl]
c_compiler: [gcc, cl]
include: include:
- os: windows-latest - os: windows-latest
c_compiler: cl c_compiler: cl
...@@ -33,14 +34,14 @@ jobs: ...@@ -33,14 +34,14 @@ jobs:
- os: ubuntu-latest - os: ubuntu-latest
c_compiler: gcc c_compiler: gcc
cpp_compiler: g++ cpp_compiler: g++
- os: ubuntu-latest # - os: ubuntu-latest
c_compiler: clang # c_compiler: clang
cpp_compiler: clang++ # cpp_compiler: clang++
exclude: exclude:
- os: windows-latest - os: windows-latest
c_compiler: gcc c_compiler: gcc
- os: windows-latest # - os: windows-latest
c_compiler: clang # c_compiler: clang
- os: ubuntu-latest - os: ubuntu-latest
c_compiler: cl c_compiler: cl
...@@ -51,13 +52,16 @@ jobs: ...@@ -51,13 +52,16 @@ jobs:
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings id: strings
shell: bash shell: bash
run: | run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install dependencies Ubuntu - name: Install dependencies Ubuntu
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
run: > run: sudo apt-get update && sudo apt-get install mrc
sudo apt-get update && sudo apt-get install mrc
- name: Install dependencies Window
if: matrix.os == 'windows-latest'
run: ./tools/depends.cmd
shell: cmd
- name: Configure CMake - name: Configure CMake
run: > run: >
......
...@@ -204,10 +204,7 @@ if(MSVC) ...@@ -204,10 +204,7 @@ if(MSVC)
endforeach() endforeach()
endif() endif()
find_package(ZLIB QUIET) find_package(ZLIB REQUIRED)
if(NOT ZLIB_FOUND)
add_subdirectory(external/zlib EXCLUDE_FROM_ALL)
endif()
find_package(Eigen3 QUIET) find_package(Eigen3 QUIET)
......
cmake_minimum_required(VERSION 3.16)
project(private-static-zlib LANGUAGES C)
include(FetchContent)
FetchContent_Declare(
zlib
GIT_REPOSITORY https://github.com/madler/zlib
GIT_TAG v1.3
)
FetchContent_Populate(zlib)
add_library(zlibstatic STATIC
${zlib_SOURCE_DIR}/adler32.c
${zlib_SOURCE_DIR}/crc32.c
${zlib_SOURCE_DIR}/deflate.c
${zlib_SOURCE_DIR}/infback.c
${zlib_SOURCE_DIR}/inffast.c
${zlib_SOURCE_DIR}/inflate.c
${zlib_SOURCE_DIR}/inftrees.c
${zlib_SOURCE_DIR}/trees.c
${zlib_SOURCE_DIR}/zutil.c
${zlib_SOURCE_DIR}/compress.c
${zlib_SOURCE_DIR}/uncompr.c
${zlib_SOURCE_DIR}/gzclose.c
${zlib_SOURCE_DIR}/gzlib.c
${zlib_SOURCE_DIR}/gzread.c
${zlib_SOURCE_DIR}/gzwrite.c)
add_library(ZLIB::ZLIB ALIAS zlibstatic)
@ECHO OFF
SET ZLIB_VERSION=1.3
IF NOT EXIST build_ci\libs (
MKDIR build_ci\libs
)
CD build_ci\libs
IF NOT EXIST zlib-%ZLIB_VERSION%.zip (
ECHO Downloading https://github.com/libarchive/zlib/archive/v%ZLIB_VERSION%.zip
curl -L -o zlib-%ZLIB_VERSION%.zip https://github.com/libarchive/zlib/archive/v%ZLIB_VERSION%.zip || EXIT /b 1
)
IF NOT EXIST zlib-%ZLIB_VERSION% (
ECHO Unpacking zlib-%ZLIB_VERSION%.zip
C:\windows\system32\tar.exe -x -f zlib-%ZLIB_VERSION%.zip || EXIT /b 1
)
CD zlib-%ZLIB_VERSION%
cmake -G "Visual Studio 17 2022" . || EXIT /b 1
cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
cmake --build . --target INSTALL --config Release || EXIT /b 1
@EXIT /b 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment