From 6bceebbb1a9698b3099935e0040f5cd3c5f5bd0d Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi <18193363+elad335@users.noreply.github.com> Date: Tue, 14 May 2024 18:52:33 +0300 Subject: [PATCH] CMake fixes Thanks to @RipleyTom Co-Authored-By: RipleyTom --- 3rdparty/zstd/CMakeLists.txt | 12 +++++------- CMakeLists.txt | 2 -- rpcs3/Emu/CMakeLists.txt | 2 +- rpcs3/util/serialization_ext.cpp | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/3rdparty/zstd/CMakeLists.txt b/3rdparty/zstd/CMakeLists.txt index ad1c3e0b97..2835a99f77 100644 --- a/3rdparty/zstd/CMakeLists.txt +++ b/3rdparty/zstd/CMakeLists.txt @@ -1,9 +1,7 @@ - -project(3rdparty_zstd) - -add_library(3rdparty_zstd INTERFACE) +option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF) +option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF) +option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON) add_subdirectory(zstd/build/cmake EXLUDE_FROM_ALL) - -target_include_directories(3rdparty_zstd INTERFACE zstd zstd/lib) - +add_library(3rdparty_zstd INTERFACE) +target_link_libraries(3rdparty_zstd INTERFACE libzstd_static) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97775039c3..4aa13efff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,8 +114,6 @@ if(MSVC) add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled endif() -set(ALLOW_DUPLICATE_CUSTOM_TARGETS TRUE) - add_subdirectory(3rdparty) if (DISABLE_LTO) diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index 1185cb3708..f394055bd0 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -25,7 +25,7 @@ endif() target_link_libraries(rpcs3_emu PRIVATE - 3rdparty::zlib 3rdparty::yaml-cpp + 3rdparty::zlib 3rdparty::yaml-cpp 3rdparty::zstd PUBLIC 3rdparty::libevdev 3rdparty::flatbuffers) diff --git a/rpcs3/util/serialization_ext.cpp b/rpcs3/util/serialization_ext.cpp index 7d529a9225..2f65f2fed7 100644 --- a/rpcs3/util/serialization_ext.cpp +++ b/rpcs3/util/serialization_ext.cpp @@ -10,7 +10,7 @@ #include "serialization_ext.hpp" #include -#include <3rdparty/zstd/zstd/lib/zstd.h> +#include LOG_CHANNEL(sys_log, "SYS");