From dfa5fccec91892468a0394355a1b60033e870ef8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 28 Mar 2024 16:33:55 +1000 Subject: [PATCH] Build: Unify shared libraries across platforms Use DLLs/shared libraries for: - libjpeg - libpng - libwebp - lz4 - SDL - zlib - zstd --- .../scripts/linux/build-dependencies-qt.sh | 174 ++++++-- .../scripts/macos/build-dependencies.sh | 104 ++++- .../scripts/windows/build-dependencies.bat | 123 ++++- .../scripts/windows/libjpeg-cmake.patch | 422 ++++++++++++++++++ .github/workflows/windows_build_qt.yml | 1 + .gitmodules | 9 - 3rdparty/libchdr/libchdr.vcxproj | 8 +- 3rdparty/libzip/libzip.vcxproj | 7 +- PCSX2_qt.sln | 135 ------ cmake/Pcsx2Utils.cmake | 10 - cmake/SearchForStuff.cmake | 55 +-- common/common.vcxproj | 8 - common/vsprops/LinkPCSX2Deps.props | 32 ++ common/vsprops/SDL2Compile.props | 39 -- common/vsprops/common.props | 9 +- pcsx2-qt/pcsx2-qt.vcxproj | 4 +- pcsx2/CMakeLists.txt | 24 +- pcsx2/pcsx2.vcxproj | 23 +- 18 files changed, 838 insertions(+), 349 deletions(-) create mode 100644 .github/workflows/scripts/windows/libjpeg-cmake.patch create mode 100644 common/vsprops/LinkPCSX2Deps.props delete mode 100644 common/vsprops/SDL2Compile.props diff --git a/.github/workflows/scripts/linux/build-dependencies-qt.sh b/.github/workflows/scripts/linux/build-dependencies-qt.sh index 4db1ce612a..8544e523a4 100755 --- a/.github/workflows/scripts/linux/build-dependencies-qt.sh +++ b/.github/workflows/scripts/linux/build-dependencies-qt.sh @@ -7,22 +7,39 @@ if [ "$#" -ne 1 ]; then exit 1 fi -INSTALLDIR="$1" +#SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) NPROCS="$(getconf _NPROCESSORS_ONLN)" -SDL=SDL2-2.30.2 -QT=6.7.0 -LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075 - +INSTALLDIR="$1" if [ "${INSTALLDIR:0:1}" != "/" ]; then INSTALLDIR="$PWD/$INSTALLDIR" fi +FREETYPE=2.13.2 +HARFBUZZ=8.3.1 +LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075 +LIBJPEG=9f +LIBPNG=1.6.43 +LIBWEBP=1.3.2 +LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29 +SDL=SDL2-2.30.2 +QT=6.7.0 +ZLIB=1.3.1 +ZSTD=1.5.5 + mkdir -p deps-build cd deps-build cat > SHASUMS < SHASUMS < ++ $ ++ ) ++ set_target_properties(libjpeg ++ PROPERTIES ++ VERSION ${PROJECT_VERSION_MAJOR} ++ POSITION_INDEPENDENT_CODE ON ++ CLEAN_DIRECT_OUTPUT ON ++ PUBLIC_HEADER "${PUBLIC_HDRS}" ++ ) ++ install(TARGETS libjpeg ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ ) ++endif() ++ ++if(BUILD_STATIC_LIBS) ++ add_library(libjpeg_static STATIC $) ++ target_include_directories(libjpeg_static ++ PUBLIC ++ $ ++ $ ++ ) ++ set_target_properties(libjpeg_static ++ PROPERTIES ++ OUTPUT_NAME jpeg ++ VERSION ${PROJECT_VERSION_MAJOR} ++ POSITION_INDEPENDENT_CODE ON ++ CLEAN_DIRECT_OUTPUT ON ++ PUBLIC_HEADER "${PUBLIC_HDRS}" ++ ) ++ install(TARGETS libjpeg_static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ ) ++endif() ++ ++# Configure and install pkg-config and libtool files ++if(BUILD_STATIC_LIBS OR BUILD_SHARED_LIBS) ++ # Compute the la file's weird version number ++ math(EXPR JPEG_CONF_VER_MAJOR "${PROJECT_VERSION_MAJOR} + ${PROJECT_VERSION_MINOR}") ++ set(JPEG_LIB_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) ++ set(JPEG_LIB_VERSION_MINOR ${PROJECT_VERSION_MINOR}) ++ ++ # Configure and install ++ configure_file(libjpeg.pc.cmakein libjpeg.pc @ONLY) ++ install(FILES ++ ${CMAKE_CURRENT_BINARY_DIR}/libjpeg.pc ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig ++ ) ++endif() ++ +diff -ruN jpeg-9f/ConfigureJConfig.cmake jpeg-9f-new/ConfigureJConfig.cmake +--- jpeg-9f/ConfigureJConfig.cmake 1970-01-01 10:00:00.000000000 +1000 ++++ jpeg-9f-new/ConfigureJConfig.cmake 2024-03-23 21:09:37.223882900 +1000 +@@ -0,0 +1,95 @@ ++include(CheckIncludeFile) ++include(CheckSymbolExists) ++include(CheckTypeSize) ++ ++# Define this if your system has an ANSI-conforming file. ++check_include_file(stddef.h HAVE_STDDEF_H) ++ ++# Define this if your system has an ANSI-conforming file. ++check_include_file(stdlib.h HAVE_STDLIB_H) ++ ++# Does your compiler support function prototypes? ++# (If not, you also need to use ansi2knr, see install.txt) ++set(HAVE_PROTOTYPES true CACHE BOOL "Does your compiler support function prototypes?") ++ ++# Does your compiler support the declaration "unsigned char" ? ++# How about "unsigned short" ? ++check_type_size("unsigned char" UNSIGNED_CHAR LANGUAGE C) ++check_type_size("unsigned short" UNSIGNED_SHORT LANGUAGE C) ++ ++# Define "void" as "char" if your compiler doesn't know about type void. ++# NOTE: be sure to define void such that "void *" represents the most general ++# pointer type, e.g., that returned by malloc(). ++# NOT IMPLEMENTED: Modify in jconfig.h.in # ++ ++# Define "const" as empty if your compiler doesn't know the "const" keyword. ++# NOT IMPLEMENTED: Modify in jconfig.h.in # ++ ++# Define this if an ordinary "char" type is unsigned. ++# If you're not sure, leaving it undefined will work at some cost in speed. ++# If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal. ++set(CHAR_IS_UNSIGNED false CACHE BOOL "char type is unsigned") ++ ++# Define this if your system does not have an ANSI/SysV , ++# but does have a BSD-style . ++set(NEED_BSD_STRINGS false CACHE BOOL "Use BSD . Use only if system lacks ANSI/SysV ") ++ ++# Define this if your system does not provide typedef size_t in any of the ++# ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in ++# instead. ++set(NEED_SYS_TYPES_H false CACHE BOOL "size_t defined in ") ++ ++# For 80x86 machines, you need to define NEED_FAR_POINTERS, ++# unless you are using a large-data memory model or 80386 flat-memory mode. ++# On less brain-damaged CPUs this symbol must not be defined. ++# (Defining this symbol causes large data structures to be referenced through ++# "far" pointers and to be allocated with a special version of malloc.) ++set(NEED_FAR_POINTERS false CACHE BOOL "Reference large data structures through 'far' pointers allocated with a special version of malloc") ++ ++# Define this if your linker needs global names to be unique in less ++# than the first 15 characters. ++set(NEED_SHORT_EXTERNAL_NAMES false CACHE BOOL "Global names must be unique in less than the first 15 characters") ++ ++# Although a real ANSI C compiler can deal perfectly well with pointers to ++# unspecified structures (see "incomplete types" in the spec), a few pre-ANSI ++# and pseudo-ANSI compilers get confused. To keep one of these bozos happy, ++# define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you ++# actually get "missing structure definition" warnings or errors while ++# compiling the JPEG code. ++set(INCOMPLETE_TYPES_BROKEN false CACHE BOOL "Disable pointers to unspecified structures") ++ ++# Define "boolean" as unsigned char, not enum, on Windows systems. ++# NOT IMPLEMENTED: Modify in jconfig.h.in # ++ ++# The following options affect code selection within the JPEG library, ++# but they don't need to be visible to applications using the library. ++# To minimize application namespace pollution, the symbols won't be ++# defined unless JPEG_INTERNALS has been defined. ++# ++ ++# Define this if your compiler implements ">>" on signed values as a logical ++# (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, ++# which is the normal and rational definition. ++set(RIGHT_SHIFT_IS_UNSIGNED false CACHE BOOL "Compiler implements >> on signed values as a logical (unsigned) shift") ++ ++# The remaining options do not affect the JPEG library proper, ++# but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). ++# Other applications can ignore these. ++# ++ ++mark_as_advanced(FORCE ++ HAVE_PROTOTYPES ++ HAVE_UNSIGNED_CHAR ++ HAVE_UNSIGNED_SHORT ++ CHAR_IS_UNSIGNED ++ HAVE_STDDEF_H ++ HAVE_STDLIB_H ++ NEED_BSD_STRINGS ++ NEED_SYS_TYPES_H ++ NEED_FAR_POINTERS ++ NEED_SHORT_EXTERNAL_NAMES ++ INCOMPLETE_TYPES_BROKEN ++ RIGHT_SHIFT_IS_UNSIGNED ++) ++ ++configure_file(jconfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/jconfig.h) +diff -ruN jpeg-9f/jconfig.h.in jpeg-9f-new/jconfig.h.in +--- jpeg-9f/jconfig.h.in 1970-01-01 10:00:00.000000000 +1000 ++++ jpeg-9f-new/jconfig.h.in 2024-03-23 21:06:05.204994600 +1000 +@@ -0,0 +1,173 @@ ++/* ++ * jconfig.h.in ++ * ++ * Copyright (C) 1991-1994, Thomas G. Lane. ++ * Modified 2009-2013 by Guido Vollbeding. ++ * This file is part of the Independent JPEG Group's software. ++ * For conditions of distribution and use, see the accompanying README file. ++ * ++ * This file is a modification of jconfig.txt from libjpeg. In addition to ++ * documenting the configuration options that are required to customize the ++ * JPEG software for a particular system, it is used by jpeg-cmake to configure ++ * jconfig.h ++ */ ++ ++ ++/* ++ * These symbols indicate the properties of your machine or compiler. ++ * #define the symbol if yes, #undef it if no. ++ */ ++ ++/* Does your compiler support function prototypes? ++ * (If not, you also need to use ansi2knr, see install.txt) ++ */ ++#cmakedefine HAVE_PROTOTYPES ++ ++/* Does your compiler support the declaration "unsigned char" ? ++ * How about "unsigned short" ? ++ */ ++#cmakedefine HAVE_UNSIGNED_CHAR ++#cmakedefine HAVE_UNSIGNED_SHORT ++ ++/* Define "void" as "char" if your compiler doesn't know about type void. ++ * NOTE: be sure to define void such that "void *" represents the most general ++ * pointer type, e.g., that returned by malloc(). ++ */ ++/* #define void char */ ++ ++/* Define "const" as empty if your compiler doesn't know the "const" keyword. ++ */ ++/* #define const */ ++ ++/* Define this if an ordinary "char" type is unsigned. ++ * If you're not sure, leaving it undefined will work at some cost in speed. ++ * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal. ++ */ ++#cmakedefine CHAR_IS_UNSIGNED ++ ++/* Define this if your system has an ANSI-conforming file. ++ */ ++#cmakedefine HAVE_STDDEF_H ++ ++/* Define this if your system has an ANSI-conforming file. ++ */ ++#cmakedefine HAVE_STDLIB_H ++ ++/* Define this if your system does not have an ANSI/SysV , ++ * but does have a BSD-style . ++ */ ++#cmakedefine NEED_BSD_STRINGS ++ ++/* Define this if your system does not provide typedef size_t in any of the ++ * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in ++ * instead. ++ */ ++#cmakedefine NEED_SYS_TYPES_H ++ ++/* For 80x86 machines, you need to define NEED_FAR_POINTERS, ++ * unless you are using a large-data memory model or 80386 flat-memory mode. ++ * On less brain-damaged CPUs this symbol must not be defined. ++ * (Defining this symbol causes large data structures to be referenced through ++ * "far" pointers and to be allocated with a special version of malloc.) ++ */ ++#cmakedefine NEED_FAR_POINTERS ++ ++/* Define this if your linker needs global names to be unique in less ++ * than the first 15 characters. ++ */ ++#cmakedefine NEED_SHORT_EXTERNAL_NAMES ++ ++/* Although a real ANSI C compiler can deal perfectly well with pointers to ++ * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI ++ * and pseudo-ANSI compilers get confused. To keep one of these bozos happy, ++ * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you ++ * actually get "missing structure definition" warnings or errors while ++ * compiling the JPEG code. ++ */ ++#cmakedefine INCOMPLETE_TYPES_BROKEN ++ ++/* Define "boolean" as unsigned char, not enum, on Windows systems. ++ */ ++#ifdef _WIN32 ++#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ ++typedef unsigned char boolean; ++#endif ++#ifndef FALSE /* in case these macros already exist */ ++#define FALSE 0 /* values of boolean */ ++#endif ++#ifndef TRUE ++#define TRUE 1 ++#endif ++#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ ++#endif ++ ++ ++/* ++ * The following options affect code selection within the JPEG library, ++ * but they don't need to be visible to applications using the library. ++ * To minimize application namespace pollution, the symbols won't be ++ * defined unless JPEG_INTERNALS has been defined. ++ */ ++ ++#ifdef JPEG_INTERNALS ++ ++/* Define this if your compiler implements ">>" on signed values as a logical ++ * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, ++ * which is the normal and rational definition. ++ */ ++#cmakedefine RIGHT_SHIFT_IS_UNSIGNED ++ ++ ++#endif /* JPEG_INTERNALS */ ++ ++ ++/* ++ * The remaining options do not affect the JPEG library proper, ++ * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). ++ * Other applications can ignore these. ++ */ ++ ++#ifdef JPEG_CJPEG_DJPEG ++ ++/* These defines indicate which image (non-JPEG) file formats are allowed. */ ++ ++#cmakedefine BMP_SUPPORTED /* BMP image file format */ ++#cmakedefine GIF_SUPPORTED /* GIF image file format */ ++#cmakedefine PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ ++#cmakedefine RLE_SUPPORTED /* Utah RLE image file format */ ++#cmakedefine TARGA_SUPPORTED /* Targa image file format */ ++ ++/* ++ * This defines the default output format for djpeg. Must be one of the FMT_* ++ * enums found in djpeg.c or djpegalt.c ++ */ ++#cmakedefine DEFAULT_FMT @DEFAULT_FMT@ ++ ++/* Define this if you want to name both input and output files on the command ++ * line, rather than using stdout and optionally stdin. You MUST do this if ++ * your system can't cope with binary I/O to stdin/stdout. See comments at ++ * head of cjpeg.c or djpeg.c. ++ */ ++#cmakedefine TWO_FILE_COMMANDLINE ++ ++/* Define this if your system needs explicit cleanup of temporary files. ++ * This is crucial under MS-DOS, where the temporary "files" may be areas ++ * of extended memory; on most other systems it's not as important. ++ */ ++#cmakedefine NEED_SIGNAL_CATCHER ++ ++/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb"). ++ * This is necessary on systems that distinguish text files from binary files, ++ * and is harmless on most systems that don't. If you have one of the rare ++ * systems that complains about the "b" spec, define this symbol. ++ */ ++#cmakedefine DONT_USE_B_MODE ++ ++/* Define this if you want percent-done progress reports from cjpeg/djpeg. ++ */ ++#cmakedefine PROGRESS_REPORT ++ ++/* Define this if you *don't* want overwrite confirmation */ ++#cmakedefine NO_OVERWRITE_CHECK ++ ++#endif /* JPEG_CJPEG_DJPEG */ +diff -ruN jpeg-9f/jmorecfg.h jpeg-9f-new/jmorecfg.h +--- jpeg-9f/jmorecfg.h 2022-03-31 19:41:26.000000000 +1000 ++++ jpeg-9f-new/jmorecfg.h 2024-03-23 21:20:25.514814400 +1000 +@@ -244,8 +244,13 @@ + #define LOCAL(type) static type + /* a function referenced thru EXTERNs: */ + #define GLOBAL(type) type ++ + /* a reference to a GLOBAL function: */ +-#define EXTERN(type) extern type ++#ifdef COMPILING_LIBJPEG ++#define EXTERN(type) __declspec(dllexport) extern type ++#else ++#define EXTERN(type) __declspec(dllimport) extern type ++#endif + + + /* This macro is used to declare a "method", that is, a function pointer. +diff -ruN jpeg-9f/libjpeg.pc.cmakein jpeg-9f-new/libjpeg.pc.cmakein +--- jpeg-9f/libjpeg.pc.cmakein 1970-01-01 10:00:00.000000000 +1000 ++++ jpeg-9f-new/libjpeg.pc.cmakein 2024-03-23 21:06:13.922695100 +1000 +@@ -0,0 +1,10 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=${prefix} ++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ ++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++ ++Name: libjpeg ++Description: Reads and writes JPEG files ++Version: @JPEG_LIB_VERSION_MAJOR@.@JPEG_LIB_VERSION_MINOR@.0 ++Libs: -L${libdir} -ljpeg ++Cflags: -I${includedir} diff --git a/.github/workflows/windows_build_qt.yml b/.github/workflows/windows_build_qt.yml index 738eabf44a..512e59c890 100644 --- a/.github/workflows/windows_build_qt.yml +++ b/.github/workflows/windows_build_qt.yml @@ -130,6 +130,7 @@ jobs: shell: cmd run: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set PATH=%PATH%;%GITHUB_WORKSPACE%\bin cmake --build build --config Release --target unittests - name: Upload artifact diff --git a/.gitmodules b/.gitmodules index 6d6c0ed41f..2624ebf1db 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,12 +18,3 @@ [submodule "3rdparty/vulkan-headers"] path = 3rdparty/vulkan-headers url = https://github.com/KhronosGroup/Vulkan-Headers.git -[submodule "3rdparty/zstd/zstd"] - path = 3rdparty/zstd/zstd - url = https://github.com/facebook/zstd.git -[submodule "3rdparty/libwebp/libwebp"] - path = 3rdparty/libwebp/libwebp - url = https://github.com/webmproject/libwebp -[submodule "3rdparty/lz4/lz4"] - path = 3rdparty/lz4/lz4 - url = https://github.com/lz4/lz4 diff --git a/3rdparty/libchdr/libchdr.vcxproj b/3rdparty/libchdr/libchdr.vcxproj index 791cd3e6d5..b24fd5161b 100644 --- a/3rdparty/libchdr/libchdr.vcxproj +++ b/3rdparty/libchdr/libchdr.vcxproj @@ -34,7 +34,7 @@ %(PreprocessorDefinitions);_7ZIP_ST TurnOffAllWarnings - $(ProjectDir)include;$(ProjectDir)src;$(SolutionDir)3rdparty\lzma\include;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\zstd\zstd\lib;%(AdditionalIncludeDirectories) + $(ProjectDir)include;$(ProjectDir)src;$(SolutionDir)3rdparty\lzma\include;$(SolutionDir)deps\include;%(AdditionalIncludeDirectories) stdcpp17 @@ -49,12 +49,6 @@ {a4323327-3f2b-4271-83d9-7f9a3c66b6b2} - - {2f6c0388-20cb-4242-9f6c-a6ebb6a83f47} - - - {52244028-937a-44e9-a76b-2bea18fd239a} - diff --git a/3rdparty/libzip/libzip.vcxproj b/3rdparty/libzip/libzip.vcxproj index d4ef22d19a..1e89f626ba 100644 --- a/3rdparty/libzip/libzip.vcxproj +++ b/3rdparty/libzip/libzip.vcxproj @@ -29,11 +29,6 @@ AllRules.ruleset - - - {52244028-937a-44e9-a76b-2bea18fd239a} - - @@ -167,7 +162,7 @@ TurnOffAllWarnings - $(SolutionDir)3rdparty\zstd\zstd\lib;$(SolutionDir)3rdparty\zlib;$(ProjectDir)msvc;$(ProjectDir)lib;%(AdditionalIncludeDirectories) + $(ProjectDir)msvc;$(ProjectDir)lib;$(SolutionDir)deps\include;%(AdditionalIncludeDirectories) diff --git a/PCSX2_qt.sln b/PCSX2_qt.sln index c041a17b28..80f9e27cea 100644 --- a/PCSX2_qt.sln +++ b/PCSX2_qt.sln @@ -9,10 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcsx2-qt", "pcsx2-qt\pcsx2- EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\soundtouch\SoundTouch.vcxproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "3rdparty\zlib\zlib.vcxproj", "{2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "3rdparty\libpng\libpng.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "3rdparty\fmt\fmt.vcxproj", "{449AD25E-424A-4714-BABC-68706CDCC33B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchdr", "3rdparty\libchdr\libchdr.vcxproj", "{A0D2B3AD-1F72-4EE3-8B5C-F2C358DA35F0}" @@ -37,8 +33,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glslang", "3rdparty\glslang EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzip", "3rdparty\libzip\libzip.vcxproj", "{20B2E9FE-F020-42A0-B324-956F5B06EA68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zstd", "3rdparty\zstd\zstd.vcxproj", "{52244028-937A-44E9-A76B-2BEA18FD239A}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "d3d12memalloc", "3rdparty\d3d12memalloc\d3d12memalloc.vcxproj", "{D45CEC7A-3171-40DD-975D-E1544CF16139}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lzma", "3rdparty\lzma\lzma.vcxproj", "{A4323327-3F2B-4271-83D9-7F9A3C66B6B2}" @@ -59,10 +53,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zydis", "3rdparty\zydis\zyd EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demangler", "3rdparty\demangler\demangler.vcxproj", "{1E3D706C-1D95-4E1B-BDF2-CA3D0007DF7F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwebp", "3rdparty\libwebp\libwebp.vcxproj", "{522DAF2A-1F24-4742-B2C4-A956411F6AB2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4", "3rdparty\lz4\lz4.vcxproj", "{39098635-446A-4FC3-9B1C-8609D94598A8}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug AVX2|x64 = Debug AVX2|x64 @@ -127,54 +117,6 @@ Global {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Release Clang|x64.Build.0 = Release Clang|x64 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Release|x64.ActiveCfg = Release|x64 {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}.Release|x64.Build.0 = Release|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug AVX2|x64.ActiveCfg = Debug|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug AVX2|x64.Build.0 = Debug|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug Clang AVX2|x64.Build.0 = Debug Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug Clang|x64.ActiveCfg = Debug Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug Clang|x64.Build.0 = Debug Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug|x64.ActiveCfg = Debug|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Debug|x64.Build.0 = Debug|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel AVX2|x64.ActiveCfg = Devel|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel AVX2|x64.Build.0 = Devel|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel Clang AVX2|x64.ActiveCfg = Devel Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel Clang AVX2|x64.Build.0 = Devel Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel Clang|x64.ActiveCfg = Devel Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel Clang|x64.Build.0 = Devel Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel|x64.ActiveCfg = Devel|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Devel|x64.Build.0 = Devel|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release AVX2|x64.ActiveCfg = Release|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release AVX2|x64.Build.0 = Release|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release Clang AVX2|x64.ActiveCfg = Release Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release Clang AVX2|x64.Build.0 = Release Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release Clang|x64.ActiveCfg = Release Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release Clang|x64.Build.0 = Release Clang|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release|x64.ActiveCfg = Release|x64 - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47}.Release|x64.Build.0 = Release|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug AVX2|x64.ActiveCfg = Debug|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug AVX2|x64.Build.0 = Debug|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Clang AVX2|x64.Build.0 = Debug Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Clang|x64.ActiveCfg = Debug Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug Clang|x64.Build.0 = Debug Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|x64.ActiveCfg = Debug|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|x64.Build.0 = Debug|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel AVX2|x64.ActiveCfg = Devel|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel AVX2|x64.Build.0 = Devel|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel Clang AVX2|x64.ActiveCfg = Devel Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel Clang AVX2|x64.Build.0 = Devel Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel Clang|x64.ActiveCfg = Devel Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel Clang|x64.Build.0 = Devel Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel|x64.ActiveCfg = Devel|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Devel|x64.Build.0 = Devel|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release AVX2|x64.ActiveCfg = Release|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release AVX2|x64.Build.0 = Release|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Clang AVX2|x64.ActiveCfg = Release Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Clang AVX2|x64.Build.0 = Release Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Clang|x64.ActiveCfg = Release Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release Clang|x64.Build.0 = Release Clang|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.ActiveCfg = Release|x64 - {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.Build.0 = Release|x64 {449AD25E-424A-4714-BABC-68706CDCC33B}.Debug AVX2|x64.ActiveCfg = Debug|x64 {449AD25E-424A-4714-BABC-68706CDCC33B}.Debug AVX2|x64.Build.0 = Debug|x64 {449AD25E-424A-4714-BABC-68706CDCC33B}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 @@ -463,30 +405,6 @@ Global {20B2E9FE-F020-42A0-B324-956F5B06EA68}.Release Clang|x64.Build.0 = Release Clang|x64 {20B2E9FE-F020-42A0-B324-956F5B06EA68}.Release|x64.ActiveCfg = Release|x64 {20B2E9FE-F020-42A0-B324-956F5B06EA68}.Release|x64.Build.0 = Release|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug AVX2|x64.ActiveCfg = Debug|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug AVX2|x64.Build.0 = Debug|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug Clang AVX2|x64.Build.0 = Debug Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug Clang|x64.ActiveCfg = Debug Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug Clang|x64.Build.0 = Debug Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug|x64.ActiveCfg = Debug|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Debug|x64.Build.0 = Debug|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel AVX2|x64.ActiveCfg = Devel|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel AVX2|x64.Build.0 = Devel|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel Clang AVX2|x64.ActiveCfg = Devel Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel Clang AVX2|x64.Build.0 = Devel Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel Clang|x64.ActiveCfg = Devel Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel Clang|x64.Build.0 = Devel Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel|x64.ActiveCfg = Devel|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Devel|x64.Build.0 = Devel|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release AVX2|x64.ActiveCfg = Release|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release AVX2|x64.Build.0 = Release|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release Clang AVX2|x64.ActiveCfg = Release Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release Clang AVX2|x64.Build.0 = Release Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release Clang|x64.ActiveCfg = Release Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release Clang|x64.Build.0 = Release Clang|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release|x64.ActiveCfg = Release|x64 - {52244028-937A-44E9-A76B-2BEA18FD239A}.Release|x64.Build.0 = Release|x64 {D45CEC7A-3171-40DD-975D-E1544CF16139}.Debug AVX2|x64.ActiveCfg = Debug|x64 {D45CEC7A-3171-40DD-975D-E1544CF16139}.Debug AVX2|x64.Build.0 = Debug|x64 {D45CEC7A-3171-40DD-975D-E1544CF16139}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 @@ -715,62 +633,12 @@ Global {1E3D706C-1D95-4E1B-BDF2-CA3D0007DF7F}.Release Clang|x64.Build.0 = Release Clang|x64 {1E3D706C-1D95-4E1B-BDF2-CA3D0007DF7F}.Release|x64.ActiveCfg = Release|x64 {1E3D706C-1D95-4E1B-BDF2-CA3D0007DF7F}.Release|x64.Build.0 = Release|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug AVX2|x64.ActiveCfg = Debug|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug AVX2|x64.Build.0 = Debug|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug Clang AVX2|x64.Build.0 = Debug Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug Clang|x64.ActiveCfg = Debug Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug Clang|x64.Build.0 = Debug Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug|x64.ActiveCfg = Debug|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Debug|x64.Build.0 = Debug|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel AVX2|x64.ActiveCfg = Devel|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel AVX2|x64.Build.0 = Devel|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel Clang AVX2|x64.ActiveCfg = Debug Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel Clang AVX2|x64.Build.0 = Debug Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel Clang|x64.ActiveCfg = Devel Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel Clang|x64.Build.0 = Devel Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel|x64.ActiveCfg = Devel|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Devel|x64.Build.0 = Devel|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release AVX2|x64.ActiveCfg = Release|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release AVX2|x64.Build.0 = Release|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release Clang AVX2|x64.ActiveCfg = Release Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release Clang AVX2|x64.Build.0 = Release Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release Clang|x64.ActiveCfg = Release Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release Clang|x64.Build.0 = Release Clang|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release|x64.ActiveCfg = Release|x64 - {522DAF2A-1F24-4742-B2C4-A956411F6AB2}.Release|x64.Build.0 = Release|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug AVX2|x64.ActiveCfg = Debug|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug AVX2|x64.Build.0 = Debug|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug Clang AVX2|x64.ActiveCfg = Debug Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug Clang AVX2|x64.Build.0 = Debug Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug Clang|x64.ActiveCfg = Debug Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug Clang|x64.Build.0 = Debug Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug|x64.ActiveCfg = Debug|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Debug|x64.Build.0 = Debug|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel AVX2|x64.ActiveCfg = Devel|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel AVX2|x64.Build.0 = Devel|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel Clang AVX2|x64.ActiveCfg = Devel Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel Clang AVX2|x64.Build.0 = Devel Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel Clang|x64.ActiveCfg = Devel Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel Clang|x64.Build.0 = Devel Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel|x64.ActiveCfg = Devel|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Devel|x64.Build.0 = Devel|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release AVX2|x64.ActiveCfg = Release|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release AVX2|x64.Build.0 = Release|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release Clang AVX2|x64.ActiveCfg = Release Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release Clang AVX2|x64.Build.0 = Release Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release Clang|x64.ActiveCfg = Release Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release Clang|x64.Build.0 = Release Clang|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release|x64.ActiveCfg = Release|x64 - {39098635-446A-4FC3-9B1C-8609D94598A8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {E9B51944-7E6D-4BCD-83F2-7BBD5A46182D} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} - {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} - {D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {449AD25E-424A-4714-BABC-68706CDCC33B} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {A0D2B3AD-1F72-4EE3-8B5C-F2C358DA35F0} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {ED2F21FD-0A36-4A8F-9B90-E7D92A2ACB63} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} @@ -781,7 +649,6 @@ Global {DE9653B6-17DD-356A-9EE0-28A731772587} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {EF6834A9-11F3-4331-BC34-21B325ABB180} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {20B2E9FE-F020-42A0-B324-956F5B06EA68} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} - {52244028-937A-44E9-A76B-2BEA18FD239A} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {D45CEC7A-3171-40DD-975D-E1544CF16139} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {A4323327-3F2B-4271-83D9-7F9A3C66B6B2} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {7E183337-A7E9-460C-9D3D-568BC9F9BCC1} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} @@ -790,8 +657,6 @@ Global {E960DFDF-1BD3-4C29-B251-D1A0919C9B09} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {67D0160C-0FE4-44B9-AC2E-82BBCF4104DF} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {1E3D706C-1D95-4E1B-BDF2-CA3D0007DF7F} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} - {522DAF2A-1F24-4742-B2C4-A956411F6AB2} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} - {39098635-446A-4FC3-9B1C-8609D94598A8} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0BC474EA-3628-45D3-9DBC-E22D0B7E0F77} diff --git a/cmake/Pcsx2Utils.cmake b/cmake/Pcsx2Utils.cmake index 4c2d126e95..6478a5b8ef 100644 --- a/cmake/Pcsx2Utils.cmake +++ b/cmake/Pcsx2Utils.cmake @@ -140,16 +140,6 @@ function(check_no_parenthesis_in_path) endif() endfunction() -# Makes an imported target if it doesn't exist. Useful for when find scripts from older versions of cmake don't make the targets you need -function(make_imported_target_if_missing target lib) - if(${lib}_FOUND AND NOT TARGET ${target}) - add_library(_${lib} INTERFACE) - target_link_libraries(_${lib} INTERFACE "${${lib}_LIBRARIES}") - target_include_directories(_${lib} INTERFACE "${${lib}_INCLUDE_DIRS}") - add_library(${target} ALIAS _${lib}) - endif() -endfunction() - # like add_library(new ALIAS old) but avoids add_library cannot create ALIAS target "new" because target "old" is imported but not globally visible. on older cmake function(alias_library new old) string(REPLACE "::" "" library_no_namespace ${old}) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 119e6d7ac9..ef912c0038 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -1,16 +1,25 @@ #------------------------------------------------------------------------------- # Search all libraries on the system #------------------------------------------------------------------------------- -if(EXISTS ${PROJECT_SOURCE_DIR}/.git) - find_package(Git) -endif() +find_package(Git) + +# Require threads on all OSes. +find_package(Threads REQUIRED) + +# Dependency libraries. +# On macOS, Mono.framework contains an ancient version of libpng. We don't want that. +# Avoid it by telling cmake to avoid finding frameworks while we search for libpng. +set(FIND_FRAMEWORK_BACKUP ${CMAKE_FIND_FRAMEWORK}) +set(CMAKE_FIND_FRAMEWORK NEVER) +find_package(PNG 1.6.40 REQUIRED) +find_package(ZLIB REQUIRED) # v1.3, but Mac uses the SDK version. +find_package(Zstd 1.5.5 REQUIRED) +find_package(LZ4 REQUIRED) +find_package(WebP REQUIRED) # v1.3.2, spews an error on Linux because no pkg-config. +find_package(SDL2 2.30.2 REQUIRED) + +# Platform-specific dependencies. if (WIN32) - # We bundle everything on Windows - add_subdirectory(3rdparty/zlib EXCLUDE_FROM_ALL) - add_subdirectory(3rdparty/libpng EXCLUDE_FROM_ALL) - add_subdirectory(3rdparty/libwebp EXCLUDE_FROM_ALL) - add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL) - add_subdirectory(3rdparty/lz4 EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/D3D12MemAlloc EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/winpixeventruntime EXCLUDE_FROM_ALL) set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/3rdparty/ffmpeg/include") @@ -21,21 +30,8 @@ if (WIN32) set(WIL_BUILD_PACKAGING OFF CACHE BOOL "") add_subdirectory(3rdparty/wil EXCLUDE_FROM_ALL) else() - find_package(PCAP REQUIRED) - - # Using find_package OpenGL without either setting your opengl preference to GLVND or LEGACY - # is deprecated as of cmake 3.11. - if(USE_OPENGL) - set(OpenGL_GL_PREFERENCE GLVND) - find_package(OpenGL REQUIRED) - endif() - # On macOS, Mono.framework contains an ancient version of libpng. We don't want that. - # Avoid it by telling cmake to avoid finding frameworks while we search for libpng. - set(FIND_FRAMEWORK_BACKUP ${CMAKE_FIND_FRAMEWORK}) - set(CMAKE_FIND_FRAMEWORK NEVER) - find_package(PNG REQUIRED) find_package(CURL REQUIRED) - set(CMAKE_FIND_FRAMEWORK ${FIND_FRAMEWORK_BACKUP}) + find_package(PCAP REQUIRED) find_package(Vtune) # Use bundled ffmpeg v4.x.x headers if we can't locate it in the system. @@ -46,11 +42,6 @@ else() set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/3rdparty/ffmpeg/include") endif() - find_package(ZLIB REQUIRED) - find_package(Zstd REQUIRED) - find_package(LZ4 REQUIRED) - find_package(WebP REQUIRED) - ## Use CheckLib package to find module include(CheckLib) @@ -81,13 +72,9 @@ else() find_package(PkgConfig REQUIRED) pkg_check_modules(DBUS REQUIRED dbus-1) endif() -endif(WIN32) +endif() -# Require threads on all OSes. -find_package(Threads REQUIRED) - -# Also need SDL2. -find_package(SDL2 2.30.2 REQUIRED) +set(CMAKE_FIND_FRAMEWORK ${FIND_FRAMEWORK_BACKUP}) set(ACTUALLY_ENABLE_TESTS ${ENABLE_TESTS}) if(ENABLE_TESTS) diff --git a/common/common.vcxproj b/common/common.vcxproj index 30a2aca5a8..b56048b90c 100644 --- a/common/common.vcxproj +++ b/common/common.vcxproj @@ -35,9 +35,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\rapidyaml\rapidyaml\ext\c4core\src\c4\ext\fast_float\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\fmt\fmt\include - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\libpng %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\jpgd - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\libwebp\libwebp\src Use PrecompiledHeader.h PrecompiledHeader.h @@ -175,12 +173,6 @@ {ed2f21fd-0a36-4a8f-9b90-e7d92a2acb63} - - {d6973076-9317-4ef2-a0b8-b7a18ac0713e} - - - {522daf2a-1f24-4742-b2c4-a956411f6ab2} - diff --git a/common/vsprops/LinkPCSX2Deps.props b/common/vsprops/LinkPCSX2Deps.props new file mode 100644 index 0000000000..bc9006bddc --- /dev/null +++ b/common/vsprops/LinkPCSX2Deps.props @@ -0,0 +1,32 @@ + + + + + + %(AdditionalDependencies);libjpeg.lib;libpng16.lib;libwebp.lib;lz4.lib;SDL2.lib;zlib.lib;zstd.lib + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/vsprops/SDL2Compile.props b/common/vsprops/SDL2Compile.props deleted file mode 100644 index f3ac4963cc..0000000000 --- a/common/vsprops/SDL2Compile.props +++ /dev/null @@ -1,39 +0,0 @@ - - - - $(SolutionDir)bin\ - $(SolutionDir)deps\ - $(SolutionDir)deps-arm64\ - - d - - - - $(SDL2Dir)include\SDL2;%(AdditionalIncludeDirectories) - - - $(SDL2Dir)lib;%(AdditionalLibraryDirectories) - SDL2$(SDL2LibSuffix).lib;%(AdditionalDependencies) - - - $(SDL2Dir)lib;%(AdditionalLibraryDirectories) - SDL2$(SDL2LibSuffix).lib;%(AdditionalDependencies) - - - - - - - - - - - - diff --git a/common/vsprops/common.props b/common/vsprops/common.props index 04e030d93c..2b0f66b346 100644 --- a/common/vsprops/common.props +++ b/common/vsprops/common.props @@ -15,6 +15,11 @@ $(SolutionDir)build\lib-$(PlatformName)-$(Configuration)\ $(SolutionDir)build\obj-$(ProjectName)-$(PlatformName)-$(Configuration)\ + $(SolutionDir)deps\ + $(SolutionDir)deps-arm64\ + $(DepsRootDir)bin\ + $(DepsRootDir)lib\ + $(DepsRootDir)include\ false @@ -22,7 +27,7 @@ true - $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) + $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories);$(DepsIncludeDir) __WIN32__;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;NOMINMAX;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;WINVER=0x0A00;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions) PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions) @@ -56,7 +61,7 @@ -flto=thin %(AdditionalOptions) - comctl32.lib;ws2_32.lib;shlwapi.lib;winmm.lib;rpcrt4.lib;iphlpapi.lib;dsound.lib;%(AdditionalDependencies) + comctl32.lib;ws2_32.lib;shlwapi.lib;winmm.lib;rpcrt4.lib;iphlpapi.lib;%(AdditionalDependencies) dxguid.lib;dinput8.lib;hid.lib;PowrProf.lib;d3dcompiler.lib;d3d11.lib;d3d12.lib;dxgi.lib;strmiids.lib;opengl32.lib;comsuppw.lib;OneCore.lib;dwmapi.lib;%(AdditionalDependencies) true Windows diff --git a/pcsx2-qt/pcsx2-qt.vcxproj b/pcsx2-qt/pcsx2-qt.vcxproj index d7f17e8172..6d79ce1ee2 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj +++ b/pcsx2-qt/pcsx2-qt.vcxproj @@ -23,7 +23,7 @@ - + @@ -36,6 +36,7 @@ + %(AdditionalIncludeDirectories);$(DepsIncludeDir)\SDL2 %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\fmt\fmt\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\lzma\include @@ -44,7 +45,6 @@ %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\demangler\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\cpuinfo\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\rapidyaml\rapidyaml\ext\c4core\src\c4\ext\fast_float\include;%(AdditionalIncludeDirectories); - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\sdl2\include;$(SolutionDir)3rdparty\sdl2\SDL\include %(AdditionalIncludeDirectories);$(SolutionDir)pcsx2 %(AdditionalIncludeDirectories);$(ProjectDir)\Settings;$(ProjectDir)\GameList;$(ProjectDir)\Tools\InputRecording;$(ProjectDir)\Debugger;$(ProjectDir)\Debugger\Models diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 0bb96daa4c..b97c82e43f 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -1146,13 +1146,8 @@ if(WIN32) dwmapi.lib OneCore.lib ) -elseif(APPLE) - target_link_libraries(PCSX2_FLAGS INTERFACE - PCAP::PCAP - ) else() target_link_libraries(PCSX2_FLAGS INTERFACE - OpenGL::GL PCAP::PCAP ) endif() @@ -1248,17 +1243,14 @@ function(setup_main_executable target) if(MSVC) install(FILES $ DESTINATION ${CMAKE_SOURCE_DIR}/bin) endif() - if(TARGET SDL2::SDL2) - # Copy SDL2 DLL to binary directory. - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - get_property(SDL2_DLL_PATH TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION_DEBUG) - else() - get_property(SDL2_DLL_PATH TARGET SDL2::SDL2 PROPERTY IMPORTED_LOCATION_RELEASE) - endif() - if(SDL2_DLL_PATH) - install(FILES ${SDL2_DLL_PATH} DESTINATION ${CMAKE_SOURCE_DIR}/bin) - endif() - endif() + + # Copy dependency libraries. + set(DEPS_BINDIR "${CMAKE_SOURCE_DIR}/deps/bin") + set(DEPS_TO_COPY freetype.dll harfbuzz.dll libjpeg.dll libpng16.dll libsharpyuv.dll libwebp.dll lz4.dll SDL2.dll zlib1.dll zstd.dll) + foreach(DEP_TO_COPY ${DEPS_TO_COPY}) + install(FILES "${DEPS_BINDIR}/${DEP_TO_COPY}" DESTINATION "${CMAKE_SOURCE_DIR}/bin") + endforeach() + find_program(WINDEPLOYQT_EXE windeployqt HINTS "${QT_BINARY_DIRECTORY}") install(CODE "execute_process(COMMAND \"${WINDEPLOYQT_EXE}\" \"${CMAKE_SOURCE_DIR}/bin/$\" --plugindir \"${CMAKE_SOURCE_DIR}/bin/QtPlugins\" --no-compiler-runtime --no-system-d3d-compiler --no-system-dxc-compiler --no-translations COMMAND_ERROR_IS_FATAL ANY)") install(CODE "file(WRITE \"${CMAKE_SOURCE_DIR}/bin/qt.conf\" \"[Paths]\\nPlugins = ./QtPlugins\")") diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index f67290762e..26d833b3b9 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -21,7 +21,6 @@ - @@ -33,19 +32,15 @@ - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\fmt\fmt\include + %(AdditionalIncludeDirectories);$(DepsIncludeDir)\SDL2 %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\include + %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\fmt\fmt\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\wil\include - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\zlib - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\lz4\lz4\lib - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\libpng %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\libchdr\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\cubeb\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\imgui\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\simpleini\include - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\sdl2\include;$(SolutionDir)3rdparty\sdl2\SDL\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\libzip\msvc;$(SolutionDir)3rdparty\libzip\lib - %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\zstd\zstd\lib %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\cpuinfo\include %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\rapidyaml\rapidyaml\src %(AdditionalIncludeDirectories);$(SolutionDir)3rdparty\rapidyaml\rapidyaml\ext\c4core\src @@ -65,7 +60,7 @@ Use PrecompiledHeader.h PrecompiledHeader.h;%(ForcedIncludeFiles) - LZMA_API_STATIC;LZ4LIB_VISIBILITY=;ST_NO_EXCEPTION_HANDLING;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) + ST_NO_EXCEPTION_HANDLING;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) XBYAK_NO_EXCEPTION;ZYCORE_STATIC_DEFINE;ZYDIS_STATIC_DEFINE;%(PreprocessorDefinitions) $(IntDir)%(RelativeDir) @@ -804,18 +799,12 @@ {449ad25e-424a-4714-babc-68706cdcc33b} - - {d6973076-9317-4ef2-a0b8-b7a18ac0713e} - {e9b51944-7e6d-4bcd-83f2-7bbd5a46182d} {a0d2b3ad-1f72-4ee3-8b5c-f2c358da35f0} - - {2f6c0388-20cb-4242-9f6c-a6ebb6a83f47} - {ed2f21fd-0a36-4a8f-9b90-e7d92a2acb63} @@ -843,12 +832,6 @@ {7e183337-a7e9-460c-9d3d-568bc9f9bcc1} - - {39098635-446a-4fc3-9b1c-8609d94598a8} - - - {a4323327-3f2b-4271-83d9-7f9a3c66b6b2} - {95dd0a0c-d14d-4cff-a593-820ef26efcc8}