From c2c3eac74949f770553ea06f2d096adc2e64ac01 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 3 Feb 2024 17:12:40 +1000 Subject: [PATCH] Build: Use shared webp/zstd/zlib --- .github/workflows/rolling-release.yml | 9 +- CMakeLists.txt | 21 +-- CMakeModules/DuckStationDependencies.cmake | 15 ++ CMakeModules/FindWebP.cmake | 166 +++++++++++++++++++++ CMakeModules/FindZstd.cmake | 45 ++++++ README.md | 8 +- dep/CMakeLists.txt | 12 +- dep/libchdr/CMakeLists.txt | 2 +- dep/minizip/CMakeLists.txt | 2 +- dep/stb/CMakeLists.txt | 2 +- dep/zlib/CMakeLists.txt | 1 + scripts/build-dependencies-mac.sh | 106 +++++++------ scripts/build-dependencies.sh | 9 +- src/common/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 2 +- src/duckstation-qt/CMakeLists.txt | 2 + src/updater/CMakeLists.txt | 2 +- src/util/CMakeLists.txt | 2 +- 18 files changed, 320 insertions(+), 88 deletions(-) create mode 100644 CMakeModules/DuckStationDependencies.cmake create mode 100644 CMakeModules/FindWebP.cmake create mode 100644 CMakeModules/FindZstd.cmake diff --git a/.github/workflows/rolling-release.yml b/.github/workflows/rolling-release.yml index cfa610425..208dd0e90 100644 --- a/.github/workflows/rolling-release.yml +++ b/.github/workflows/rolling-release.yml @@ -232,7 +232,8 @@ jobs: extra-cmake-modules libcurl4-openssl-dev libssl-dev libasound2-dev libpulse-dev libx11-xcb-dev build-essential git libclang-dev \ libclang-11-dev libclang-12-dev patchelf libglib2.0-dev libfontconfig1-dev libharfbuzz-dev libjpeg-dev libpng-dev libfreetype-dev \ libinput-dev libxcb-*-dev libxkbcommon-dev libxkbcommon-x11-dev libxrender-dev libwayland-dev libgl1-mesa-dev libegl-dev \ - libegl1-mesa-dev libgl1-mesa-dev libssl-dev libx11-dev libx11-xcb-dev libfuse2 llvm-16 lld-16 clang-16 + libwebp-dev libzstd-dev libegl1-mesa-dev libgl1-mesa-dev libssl-dev libx11-dev libx11-xcb-dev libfuse2 \ + llvm-16 lld-16 clang-16 - name: Cache Dependencies id: cache-deps @@ -243,7 +244,7 @@ jobs: - name: Build Dependencies if: steps.cache-deps.outputs.cache-hit != 'true' - run: scripts/build-dependencies.sh + run: scripts/build-dependencies.sh "$HOME/deps" - name: Tag as preview build if: github.ref == 'refs/heads/master' @@ -324,7 +325,7 @@ jobs: macos-build: - runs-on: macos-11 + runs-on: macos-14 timeout-minutes: 120 steps: - uses: actions/checkout@v4.1.1 @@ -350,7 +351,7 @@ jobs: - name: Build Dependencies if: steps.cache-deps-mac.outputs.cache-hit != 'true' - run: scripts/build-dependencies-mac.sh + run: scripts/build-dependencies-mac.sh "$HOME/deps" - name: Tag as preview build if: github.ref == 'refs/heads/master' diff --git a/CMakeLists.txt b/CMakeLists.txt index 47d008798..c0690aae9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,32 +44,12 @@ if(NOT ANDROID) endif() endif() - -# Required libraries. -if(ENABLE_SDL2) - find_package(SDL2 2.28.5 REQUIRED) -endif() -if(NOT WIN32 AND NOT ANDROID) - find_package(CURL REQUIRED) - if(NOT APPLE) - find_package(Libbacktrace) - if(NOT LIBBACKTRACE_FOUND) - message(WARNING "libbacktrace not found, crashes will not produce backtraces.") - endif() - endif() -endif() -if(BUILD_QT_FRONTEND) - find_package(Qt6 6.5.3 COMPONENTS Core Gui Widgets Network LinguistTools REQUIRED) -endif() - - # Everything except Windows/Mac use EGL. if(ENABLE_OPENGL AND (LINUX OR FREEBSD OR ANDROID)) find_package(EGL REQUIRED) set(ENABLE_EGL TRUE) endif() - if(ENABLE_X11) find_package(X11 REQUIRED) if (NOT X11_Xrandr_FOUND) @@ -246,6 +226,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Recursively include the source tree. +include(DuckStationDependencies) add_subdirectory(dep) # Use C++20 for building the main libraries. diff --git a/CMakeModules/DuckStationDependencies.cmake b/CMakeModules/DuckStationDependencies.cmake new file mode 100644 index 000000000..d1f0de454 --- /dev/null +++ b/CMakeModules/DuckStationDependencies.cmake @@ -0,0 +1,15 @@ +if(ENABLE_SDL2) + find_package(SDL2 2.30.0 REQUIRED) +endif() +if(NOT WIN32 AND NOT ANDROID) + find_package(CURL REQUIRED) + find_package(Zstd REQUIRED) + find_package(WebP REQUIRED) + find_package(ZLIB REQUIRED) +endif() +if(UNIX AND NOT APPLE) + find_package(Libbacktrace) + if(NOT LIBBACKTRACE_FOUND) + message(WARNING "libbacktrace not found, crashes will not produce backtraces.") + endif() +endif() diff --git a/CMakeModules/FindWebP.cmake b/CMakeModules/FindWebP.cmake new file mode 100644 index 000000000..688419eb8 --- /dev/null +++ b/CMakeModules/FindWebP.cmake @@ -0,0 +1,166 @@ +# Copyright (C) 2020 Sony Interactive Entertainment Inc. +# Copyright (C) 2012 Raphael Kubo da Costa +# Copyright (C) 2013 Igalia S.L. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#[=======================================================================[.rst: +FindWebP +-------------- + +Find WebP headers and libraries. + +Imported Targets +^^^^^^^^^^^^^^^^ + +``WebP::libwebp`` + The WebP library, if found. + +``WebP::demux`` + The WebP demux library, if found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables in your project: + +``WebP_FOUND`` + true if (the requested version of) WebP is available. +``WebP_VERSION`` + the version of WebP. +``WebP_LIBRARIES`` + the libraries to link against to use WebP. +``WebP_INCLUDE_DIRS`` + where to find the WebP headers. +``WebP_COMPILE_OPTIONS`` + this should be passed to target_compile_options(), if the + target is not used for linking + +#]=======================================================================] + +find_package(PkgConfig QUIET) +pkg_check_modules(PC_WEBP QUIET libwebp) +set(WebP_COMPILE_OPTIONS ${PC_WEBP_CFLAGS_OTHER}) +set(WebP_VERSION ${PC_WEBP_CFLAGS_VERSION}) + +find_path(WebP_INCLUDE_DIR + NAMES webp/decode.h + HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS} +) + +find_library(WebP_LIBRARY + NAMES ${WebP_NAMES} webp libwebp + HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} +) + +# There's nothing in the WebP headers that could be used to detect the exact +# WebP version being used so don't attempt to do so. A version can only be found +# through pkg-config +if ("${WebP_FIND_VERSION}" VERSION_GREATER "${WebP_VERSION}") + if (WebP_VERSION) + message(FATAL_ERROR "Required version (" ${WebP_FIND_VERSION} ") is higher than found version (" ${WebP_VERSION} ")") + else () + message(WARNING "Cannot determine WebP version without pkg-config") + endif () +endif () + +# Find components +if (WebP_INCLUDE_DIR AND WebP_LIBRARY) + set(_WebP_REQUIRED_LIBS_FOUND ON) + set(WebP_LIBS_FOUND "WebP (required): ${WebP_LIBRARY}") +else () + set(_WebP_REQUIRED_LIBS_FOUND OFF) + set(WebP_LIBS_NOT_FOUND "WebP (required)") +endif () + +if ("demux" IN_LIST WebP_FIND_COMPONENTS) + find_library(WebP_DEMUX_LIBRARY + NAMES ${WebP_DEMUX_NAMES} webpdemux libwebpdemux + HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} + ) + + if (WebP_DEMUX_LIBRARY) + if (WebP_FIND_REQUIRED_demux) + list(APPEND WebP_LIBS_FOUND "demux (required): ${WebP_DEMUX_LIBRARY}") + else () + list(APPEND WebP_LIBS_FOUND "demux (optional): ${WebP_DEMUX_LIBRARY}") + endif () + else () + if (WebP_FIND_REQUIRED_demux) + set(_WebP_REQUIRED_LIBS_FOUND OFF) + list(APPEND WebP_LIBS_NOT_FOUND "demux (required)") + else () + list(APPEND WebP_LIBS_NOT_FOUND "demux (optional)") + endif () + endif () +endif () + +if (NOT WebP_FIND_QUIETLY) + if (WebP_LIBS_FOUND) + message(STATUS "Found the following WebP libraries:") + foreach (found ${WebP_LIBS_FOUND}) + message(STATUS " ${found}") + endforeach () + endif () + if (WebP_LIBS_NOT_FOUND) + message(STATUS "The following WebP libraries were not found:") + foreach (found ${WebP_LIBS_NOT_FOUND}) + message(STATUS " ${found}") + endforeach () + endif () +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WebP + FOUND_VAR WebP_FOUND + REQUIRED_VARS WebP_INCLUDE_DIR WebP_LIBRARY _WebP_REQUIRED_LIBS_FOUND + VERSION_VAR WebP_VERSION +) + +if (WebP_LIBRARY AND NOT TARGET WebP::libwebp) + add_library(WebP::libwebp UNKNOWN IMPORTED GLOBAL) + set_target_properties(WebP::libwebp PROPERTIES + IMPORTED_LOCATION "${WebP_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${WebP_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${WebP_INCLUDE_DIR}" + ) +endif () + +if (WebP_DEMUX_LIBRARY AND NOT TARGET WebP::demux) + add_library(WebP::demux UNKNOWN IMPORTED GLOBAL) + set_target_properties(WebP::demux PROPERTIES + IMPORTED_LOCATION "${WebP_DEMUX_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${WebP_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${WebP_INCLUDE_DIR}" + ) +endif () + +mark_as_advanced( + WebP_INCLUDE_DIR + WebP_LIBRARY + WebP_DEMUX_LIBRARY +) + +if (WebP_FOUND) + set(WebP_LIBRARIES ${WebP_LIBRARY} ${WebP_DEMUX_LIBRARY}) + set(WebP_INCLUDE_DIRS ${WebP_INCLUDE_DIR}) +endif () diff --git a/CMakeModules/FindZstd.cmake b/CMakeModules/FindZstd.cmake new file mode 100644 index 000000000..ce6b774d7 --- /dev/null +++ b/CMakeModules/FindZstd.cmake @@ -0,0 +1,45 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# - Try to find Facebook zstd library +# This will define +# Zstd_FOUND +# Zstd_INCLUDE_DIR +# Zstd_LIBRARY +# + +find_path(Zstd_INCLUDE_DIR NAMES zstd.h) + +find_library(Zstd_LIBRARY_DEBUG NAMES zstdd zstd_staticd) +find_library(Zstd_LIBRARY_RELEASE NAMES zstd zstd_static) + +include(SelectLibraryConfigurations) +SELECT_LIBRARY_CONFIGURATIONS(Zstd) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + Zstd DEFAULT_MSG + Zstd_LIBRARY Zstd_INCLUDE_DIR +) + +mark_as_advanced(Zstd_INCLUDE_DIR Zstd_LIBRARY) + +if(Zstd_FOUND AND NOT (TARGET Zstd::Zstd)) + add_library (Zstd::Zstd UNKNOWN IMPORTED) + set_target_properties(Zstd::Zstd + PROPERTIES + IMPORTED_LOCATION ${Zstd_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${Zstd_INCLUDE_DIR}) +endif() diff --git a/README.md b/README.md index 817475498..0c35e03d1 100644 --- a/README.md +++ b/README.md @@ -145,9 +145,9 @@ Requirements: ### Linux Requirements (Debian/Ubuntu package names): - CMake (`cmake`) - - SDL2 (at least version 2.28.5) (`libsdl2-dev` `libxrandr-dev`) + - SDL2 (at least version 2.30.0) (`libsdl2-dev` `libxrandr-dev`) - pkgconfig (`pkg-config`) - - Qt 6 (at least version 6.5.3) (`qt6-base-dev` `qt6-base-private-dev` `qt6-base-dev-tools` `qt6-tools-dev` `libqt6svg6`) + - Qt 6 (at least version 6.6.0) (`qt6-base-dev` `qt6-base-private-dev` `qt6-base-dev-tools` `qt6-tools-dev` `libqt6svg6`) - git (`git`) (Note: needed to clone the repository and at build time) - When Wayland is enabled (default): (`libwayland-dev` `libwayland-egl-backend-dev` `extra-cmake-modules` `qt6-wayland`) - libcurl (`libcurl4-openssl-dev`) @@ -163,8 +163,8 @@ Requirements (Debian/Ubuntu package names): Requirements: - CMake - - SDL2 (at least version 2.28.5) - - Qt 6 (at least version 6.5.3) + - SDL2 (at least version 2.30.0) + - Qt 6 (at least version 6.6.0) Optional (recommended for faster builds): - Ninja diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 527cac294..c10b6b36a 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -3,10 +3,6 @@ add_subdirectory(fmt EXCLUDE_FROM_ALL) disable_compiler_warnings_for_target(fmt) add_subdirectory(stb EXCLUDE_FROM_ALL) disable_compiler_warnings_for_target(stb) -add_subdirectory(zlib EXCLUDE_FROM_ALL) -disable_compiler_warnings_for_target(zlib) -add_subdirectory(zstd EXCLUDE_FROM_ALL) -disable_compiler_warnings_for_target(zstd) add_subdirectory(minizip EXCLUDE_FROM_ALL) disable_compiler_warnings_for_target(minizip) add_subdirectory(lzma EXCLUDE_FROM_ALL) @@ -34,6 +30,14 @@ disable_compiler_warnings_for_target(reshadefx) add_subdirectory(rcheevos EXCLUDE_FROM_ALL) disable_compiler_warnings_for_target(rcheevos) +# Build dependencies on Windows/Android. +if(WIN32 OR ANDROID) + add_subdirectory(zlib EXCLUDE_FROM_ALL) + disable_compiler_warnings_for_target(zlib) + add_subdirectory(zstd EXCLUDE_FROM_ALL) + disable_compiler_warnings_for_target(zstd) +endif() + if(ENABLE_CUBEB) add_subdirectory(cubeb EXCLUDE_FROM_ALL) disable_compiler_warnings_for_target(cubeb) diff --git a/dep/libchdr/CMakeLists.txt b/dep/libchdr/CMakeLists.txt index 05b8c7ad6..d27f579a4 100644 --- a/dep/libchdr/CMakeLists.txt +++ b/dep/libchdr/CMakeLists.txt @@ -15,5 +15,5 @@ add_library(libchdr ) target_include_directories(libchdr PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(libchdr PRIVATE zlib lzma) +target_link_libraries(libchdr PRIVATE ZLIB::ZLIB lzma) diff --git a/dep/minizip/CMakeLists.txt b/dep/minizip/CMakeLists.txt index 6a05c01bf..3da43c239 100644 --- a/dep/minizip/CMakeLists.txt +++ b/dep/minizip/CMakeLists.txt @@ -18,5 +18,5 @@ endif() target_include_directories(minizip PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(minizip INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(minizip zlib) +target_link_libraries(minizip ZLIB::ZLIB) diff --git a/dep/stb/CMakeLists.txt b/dep/stb/CMakeLists.txt index 8206b100c..bb5b8b338 100644 --- a/dep/stb/CMakeLists.txt +++ b/dep/stb/CMakeLists.txt @@ -10,4 +10,4 @@ set(SRCS add_library(stb ${SRCS}) target_include_directories(stb PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src") target_include_directories(stb INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(stb zlib Threads::Threads "${CMAKE_DL_LIBS}") +target_link_libraries(stb ZLIB::ZLIB Threads::Threads "${CMAKE_DL_LIBS}") diff --git a/dep/zlib/CMakeLists.txt b/dep/zlib/CMakeLists.txt index 2e4686714..85a6fbebe 100644 --- a/dep/zlib/CMakeLists.txt +++ b/dep/zlib/CMakeLists.txt @@ -29,3 +29,4 @@ add_library(zlib target_include_directories(zlib PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(zlib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") +add_library(ZLIB::ZLIB ALIAS zlib) diff --git a/scripts/build-dependencies-mac.sh b/scripts/build-dependencies-mac.sh index 3b2c5f17b..29d3ec95b 100755 --- a/scripts/build-dependencies-mac.sh +++ b/scripts/build-dependencies-mac.sh @@ -2,12 +2,35 @@ set -e +merge_binaries() { + X86DIR=$1 + ARMDIR=$2 + echo "Merging ARM64 binaries from $ARMDIR into fat binaries at $X86DIR..." + + IFS=" +" + pushd "$X86DIR" + for X86BIN in $(find . -type f \( -name '*.dylib' -o -name '*.a' -o -perm +111 \)); do + ARMBIN="${ARMDIR}/${X86BIN}" + echo "Merge $ARMBIN to $X86BIN..." + lipo -create "$X86BIN" "$ARMBIN" -o "$X86BIN" + done + popd +} + +if [ "$#" -ne 1 ]; then + echo "Syntax: $0 " + exit 1 +fi + export MACOSX_DEPLOYMENT_TARGET=11.0 -INSTALLDIR="$HOME/deps" +INSTALLDIR="$1" NPROCS="$(getconf _NPROCESSORS_ONLN)" SDL=SDL2-2.30.0 QT=6.6.0 MOLTENVK=1.2.6 +ZSTD=1.5.5 +WEBP=1.3.2 mkdir -p deps-build cd deps-build @@ -20,6 +43,8 @@ export CXXFLAGS="-I$INSTALLDIR/include -Os $CXXFLAGS" cat > SHASUMS <" + exit 1 +fi + +INSTALLDIR="$1" NPROCS="$(getconf _NPROCESSORS_ONLN)" SDL=SDL2-2.30.0 QT=6.6.1 @@ -45,7 +50,7 @@ cd .. echo "Building libbacktrace..." unzip "$LIBBACKTRACE.zip" cd "libbacktrace-$LIBBACKTRACE" -./configure --prefix="$HOME/deps" +./configure --prefix="$INSTALLDIR" make make install cd .. diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 9c7f59158..35f75a128 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -61,7 +61,7 @@ add_library(common target_include_directories(common PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_link_libraries(common PUBLIC fmt Threads::Threads fast_float) -target_link_libraries(common PRIVATE stb zlib minizip Zstd::Zstd "${CMAKE_DL_LIBS}") +target_link_libraries(common PRIVATE stb ZLIB::ZLIB minizip Zstd::Zstd "${CMAKE_DL_LIBS}") if(WIN32) target_sources(common PRIVATE diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 4d60f8e0c..e685cfaf6 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -130,7 +130,7 @@ set(NEWREC_SOURCES target_precompile_headers(core PRIVATE "pch.h") target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") -target_link_libraries(core PUBLIC Threads::Threads common util zlib) +target_link_libraries(core PUBLIC Threads::Threads common util ZLIB::ZLIB) target_link_libraries(core PRIVATE stb xxhash imgui rapidjson rcheevos) if(CPU_ARCH_X64) diff --git a/src/duckstation-qt/CMakeLists.txt b/src/duckstation-qt/CMakeLists.txt index b8596311b..ca6972170 100644 --- a/src/duckstation-qt/CMakeLists.txt +++ b/src/duckstation-qt/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(Qt6 6.6.0 COMPONENTS Core Gui Widgets Network LinguistTools REQUIRED) + include(CopyBaseTranslations) set(CMAKE_AUTOMOC ON) diff --git a/src/updater/CMakeLists.txt b/src/updater/CMakeLists.txt index 438a9da1f..78ae35c46 100644 --- a/src/updater/CMakeLists.txt +++ b/src/updater/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(updater updater.h ) -target_link_libraries(updater PRIVATE common minizip zlib) +target_link_libraries(updater PRIVATE common minizip ZLIB::ZLIB) if(WIN32) target_sources(updater PRIVATE diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 35c765fad..d7862a42a 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -73,7 +73,7 @@ target_precompile_headers(util PRIVATE "pch.h") target_include_directories(util PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(util PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_link_libraries(util PUBLIC common simpleini imgui) -target_link_libraries(util PRIVATE stb libchdr zlib soundtouch xxhash Zstd::Zstd reshadefx) +target_link_libraries(util PRIVATE stb libchdr ZLIB::ZLIB soundtouch xxhash Zstd::Zstd reshadefx) if(ENABLE_CUBEB) target_sources(util PRIVATE