mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
build: add zstd and ZArchive submodules
Build zstd v1.5.7 and ZArchive from source as static, position-independent libraries that are not part of the default target set. Their symbols stay out of the dynamic export table of the library that links them.
This commit is contained in:
1 parent
93e54cedd3
commit
aa8c2f65e2
5 files changed
+35
No files matched your search
@@ -40,3 +40,9 @@
|
||||
[submodule "3rdparty/mbedtls"]
|
||||
path = 3rdparty/mbedtls
|
||||
url = https://github.com/Mbed-TLS/mbedtls.git
|
||||
[submodule "3rdparty/zstd"]
|
||||
path = 3rdparty/zstd
|
||||
url = https://github.com/facebook/zstd.git
|
||||
[submodule "3rdparty/ZArchive"]
|
||||
path = 3rdparty/ZArchive
|
||||
url = https://github.com/Exzap/ZArchive.git
|
||||
+1
Submodule 3rdparty/ZArchive added at 965b66c8d6.
+1
Submodule 3rdparty/zstd added at f8745da6ff.
@@ -267,6 +267,8 @@ set(LIBUSB_ENABLE_UDEV OFF CACHE BOOL "" FORCE)
|
||||
add_subdirectory(3rdparty/libusb-cmake EXCLUDE_FROM_ALL)
|
||||
set_target_properties(usb-1.0 PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
include(cmake/ZArchive.cmake)
|
||||
|
||||
add_subdirectory(core/shader/recompiler)
|
||||
add_subdirectory(core/Decoder/Jpeg)
|
||||
add_subdirectory(core/Decoder/Png)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
enable_language(C)
|
||||
|
||||
set(ZSTD_BUILD_PROGRAMS OFF CACHE BOOL "" FORCE)
|
||||
set(ZSTD_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(ZSTD_BUILD_CONTRIB OFF CACHE BOOL "" FORCE)
|
||||
set(ZSTD_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
||||
set(ZSTD_BUILD_STATIC ON CACHE BOOL "" FORCE)
|
||||
set(ZSTD_LEGACY_SUPPORT OFF CACHE BOOL "" FORCE)
|
||||
set(ZSTD_MULTITHREAD_SUPPORT OFF CACHE BOOL "" FORCE)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/zstd/build/cmake ${CMAKE_BINARY_DIR}/3rdparty/zstd EXCLUDE_FROM_ALL)
|
||||
set_target_properties(libzstd_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(ZARCHIVE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/ZArchive)
|
||||
add_library(zarchive STATIC EXCLUDE_FROM_ALL
|
||||
${ZARCHIVE_SOURCE_DIR}/src/zarchivereader.cpp
|
||||
${ZARCHIVE_SOURCE_DIR}/src/zarchivewriter.cpp
|
||||
${ZARCHIVE_SOURCE_DIR}/src/sha_256.c
|
||||
)
|
||||
target_include_directories(zarchive SYSTEM PUBLIC ${ZARCHIVE_SOURCE_DIR}/include)
|
||||
target_compile_features(zarchive PUBLIC cxx_std_20)
|
||||
target_link_libraries(zarchive PRIVATE libzstd_static)
|
||||
set_target_properties(zarchive PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_options(zarchive INTERFACE LINKER:--exclude-libs,libzarchive.a:libzstd.a)
|
||||
endif()
|
||||
Reference in new issue
Block a user