Skip to content

Commit 1ccd750

Browse files
committed
CMake: Avoid using system zlib outside of MacOS
1 parent b3caf07 commit 1ccd750

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

CMakeModules/DuckStationDependencies.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ if(NOT WIN32 AND NOT APPLE)
1515
endif()
1616

1717
# libpng relies on zlib, which we need the system version for on Mac.
18-
find_package(ZLIB REQUIRED)
18+
if(APPLE OR CPU_ARCH_ARM32 OR CPU_ARCH_ARM64)
19+
find_package(ZLIB REQUIRED)
20+
endif()
1921

2022
# Enforce use of bundled dependencies to avoid conflicts with system libraries.
2123
set(FIND_ROOT_PATH_BACKUP ${CMAKE_FIND_ROOT_PATH})
@@ -29,12 +31,17 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
2931
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
3032
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
3133

34+
# Search for local zlib version outside of Mac.
35+
if(NOT APPLE AND NOT CPU_ARCH_ARM32 AND NOT CPU_ARCH_ARM64)
36+
find_package(ZLIB 1.3.1 REQUIRED)
37+
endif()
38+
3239
# Bundled dependencies.
33-
find_package(SDL3 3.2.26 REQUIRED)
3440
find_package(zstd 1.5.7 REQUIRED)
3541
find_package(WebP REQUIRED) # v1.4.0, spews an error on Linux because no pkg-config.
3642
find_package(PNG 1.6.50 REQUIRED)
3743
find_package(JPEG REQUIRED)
44+
find_package(SDL3 3.2.26 REQUIRED)
3845
find_package(Freetype 2.13.3 REQUIRED)
3946
find_package(harfbuzz REQUIRED)
4047
find_package(plutosvg 0.0.6 REQUIRED)

0 commit comments

Comments
 (0)