From 6c44664c1934b2ed3cab8564ae6609861fe873ce Mon Sep 17 00:00:00 2001 From: polar Date: Wed, 2 Jun 2021 06:33:50 +0100 Subject: [PATCH] BUILD: Refactor zlib submodule (#10393) --- .gitmodules | 2 +- 3rdparty/CMakeLists.txt | 16 +--------------- 3rdparty/libpng/libpng.vcxproj | 2 +- 3rdparty/libpng/pnglibconf.vcxproj | 2 +- 3rdparty/zlib/CMakeLists.txt | 14 ++++++++++++++ 3rdparty/{ => zlib}/zlib | 0 3rdparty/{ => zlib}/zlib.props | 2 +- 3rdparty/{ => zlib}/zlib.vcxproj | 2 +- rpcs3.sln | 2 +- rpcs3/emucore.vcxproj | 2 +- rpcs3/rpcs3.vcxproj | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 3rdparty/zlib/CMakeLists.txt rename 3rdparty/{ => zlib}/zlib (100%) rename 3rdparty/{ => zlib}/zlib.props (96%) rename 3rdparty/{ => zlib}/zlib.vcxproj (98%) diff --git a/.gitmodules b/.gitmodules index cb00d4f21e..80fb5f6c91 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ url = ../../RPCS3/cereal.git ignore = dirty [submodule "3rdparty/zlib"] - path = 3rdparty/zlib + path = 3rdparty/zlib/zlib url = ../../madler/zlib ignore = dirty [submodule "3rdparty/hidapi"] diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index fdd8472893..338d756b0b 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -7,21 +7,7 @@ add_library(3rdparty_dummy_lib INTERFACE) # ZLib -if (USE_SYSTEM_ZLIB) - find_package(ZLIB QUIET) -endif() - -if (NOT ZLIB_FOUND) - message(STATUS "Using builtin ZLIB") - set(SKIP_INSTALL_ALL ON) - add_subdirectory(zlib EXCLUDE_FROM_ALL) - set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib" "${CMAKE_CURRENT_BINARY_DIR}/zlib") - set(ZLIB_LIBRARY zlibstatic) -endif() - -add_library(3rdparty_zlib INTERFACE) -target_link_libraries(3rdparty_zlib INTERFACE ${ZLIB_LIBRARY}) -target_include_directories(3rdparty_zlib INTERFACE ${ZLIB_INCLUDE_DIR}) +add_subdirectory(zlib EXCLUDE_FROM_ALL) # 7z sdk add_subdirectory(7z EXCLUDE_FROM_ALL) diff --git a/3rdparty/libpng/libpng.vcxproj b/3rdparty/libpng/libpng.vcxproj index bab0d61dbb..658a9acf5f 100644 --- a/3rdparty/libpng/libpng.vcxproj +++ b/3rdparty/libpng/libpng.vcxproj @@ -15,7 +15,7 @@ Win32Proj libpng - + diff --git a/3rdparty/libpng/pnglibconf.vcxproj b/3rdparty/libpng/pnglibconf.vcxproj index 245efc49fe..e4a22c8af6 100644 --- a/3rdparty/libpng/pnglibconf.vcxproj +++ b/3rdparty/libpng/pnglibconf.vcxproj @@ -19,7 +19,7 @@ true MultiByte - + x64 diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt new file mode 100644 index 0000000000..048ae1dcf5 --- /dev/null +++ b/3rdparty/zlib/CMakeLists.txt @@ -0,0 +1,14 @@ +if (USE_SYSTEM_ZLIB) + message(STATUS "-- RPCS3: Using syztem ZLIB") + find_package(ZLIB QUIET) +else() + message(STATUS "-- RPCS3: Using builtin ZLIB") + set(SKIP_INSTALL_ALL ON) + add_subdirectory(zlib EXCLUDE_FROM_ALL) + set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib" "${CMAKE_CURRENT_BINARY_DIR}/zlib") + set(ZLIB_LIBRARY zlibstatic) +endif() + +add_library(3rdparty_zlib INTERFACE) +target_link_libraries(3rdparty_zlib INTERFACE ${ZLIB_LIBRARY}) +target_include_directories(3rdparty_zlib INTERFACE ${ZLIB_INCLUDE_DIR}) diff --git a/3rdparty/zlib b/3rdparty/zlib/zlib similarity index 100% rename from 3rdparty/zlib rename to 3rdparty/zlib/zlib diff --git a/3rdparty/zlib.props b/3rdparty/zlib/zlib.props similarity index 96% rename from 3rdparty/zlib.props rename to 3rdparty/zlib/zlib.props index 8a99353108..3fd38a426f 100644 --- a/3rdparty/zlib.props +++ b/3rdparty/zlib/zlib.props @@ -32,7 +32,7 @@ versions do not match. The zlib version used in this build is recorded below: --> - $(SolutionDir)3rdparty\zlib\ + $(SolutionDir)3rdparty\zlib\zlib\