Skip to content

Commit c8fd990

Browse files
committed
unzip: Link against real zlib.
1 parent 959a453 commit c8fd990

24 files changed

+24
-3957
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ jobs:
5757
run: |
5858
sudo apt update
5959
sudo apt install -y --no-install-recommends \
60-
ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev
60+
ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev zlib1g-dev
6161
6262
- name: Configure CMake
6363
env:
6464
CC: ${{ matrix.os.cc }}
6565
CXX: ${{ matrix.os.cxx }}
66+
VCPKG_ROOT: C:/vcpkg
6667
run: cmake --preset ${{ matrix.os.preset }}
6768

6869
- name: Debug Build

Brewfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ brew "sdl2_image"
1010

1111
brew "cmake"
1212
brew "ninja"
13+
14+
# zlib
15+
brew "zlib"

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ if(LOGGER)
104104
add_definitions(-DLOGGER)
105105
endif()
106106

107+
find_package(ZLIB REQUIRED)
108+
107109
include_directories("lib" "Descent3" ${PLATFORM_INCLUDES})
108110

109111
# file(GLOB_RECURSE INCS "*.h")

CMakePresets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"lhs": "${hostSystemName}",
1616
"rhs": "Windows"
1717
},
18-
"architecture": "Win32"
18+
"architecture": "Win32",
19+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
1920
},
2021
{
2122
"name": "mac",

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Back up your `Descent3` binary and drop your built `Descent3` binary into the in
2525
Build steps below assume you have already cloned the repository and entered it locally.
2626

2727
#### Building - Windows
28-
Requires Visual Studio C++ Tools (cmake and nmake)
28+
Requires Visual Studio C++ Tools (cmake and vcpkg)
2929
```sh
3030
cmake --preset win
3131
cmake --build --preset win --config [Debug/Release] -D LOGGER=[ON|OFF]
@@ -42,7 +42,7 @@ cmake --build --preset mac --config [Debug/Release] -D LOGGER=[ON|OFF]
4242
```sh
4343
sudo dpkg --add-architecture i386
4444
sudo apt update
45-
sudo apt install -y --no-install-recommends ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev libxext6:i386
45+
sudo apt install -y --no-install-recommends ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev libxext6:i386 zlib1g-dev
4646
cmake --preset linux
4747
cmake --build --preset linux --config [Debug/Release] -D LOGGER=[ON|OFF]
4848
```

unzip/CMakeLists.txt

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
set(HEADERS
2-
infblock.h
3-
infcodes.h
4-
inffast.h
5-
inffixed.h
6-
inftrees.h
7-
infutil.h
8-
zconf.h
9-
zlib.h
10-
zutil.h)
11-
set(CPPS
12-
unzip.cpp
13-
adler32.c
14-
infblock.c
15-
infcodes.c
16-
inffast.c
17-
inflate.c
18-
inftrees.c
19-
infutil.c)
1+
set(HEADERS)
2+
set(CPPS unzip.cpp)
203

214
add_library(unzip STATIC ${HEADERS} ${CPPS})
5+
6+
target_link_libraries(unzip ZLIB::ZLIB)

unzip/adler32.c

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)