mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2026-02-04 14:12:18 +08:00
use FetchContent for zstd library
This commit is contained in:
@@ -5,13 +5,30 @@ project(zstdwrap)
|
|||||||
add_library(zstdwrap SHARED
|
add_library(zstdwrap SHARED
|
||||||
dllmain.c zstdwrap.c zstdwrap.h)
|
dllmain.c zstdwrap.c zstdwrap.h)
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
|
set(ZSTD_BUILD_STATIC ON)
|
||||||
|
set(ZSTD_BUILD_SHARED OFF)
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
zstd
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP ON
|
||||||
|
URL https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz
|
||||||
|
URL_HASH SHA256=eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3
|
||||||
|
SOURCE_SUBDIR build/cmake
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
|
)
|
||||||
|
|
||||||
|
FetchContent_MakeAvailable(zstd)
|
||||||
|
|
||||||
|
target_include_directories(zstdwrap PRIVATE ${zstd_SOURCE_DIR}/lib)
|
||||||
target_compile_definitions(zstdwrap PRIVATE ZSTDWRAP_EXPORTS ZSTDLIB_STATIC_API)
|
target_compile_definitions(zstdwrap PRIVATE ZSTDWRAP_EXPORTS ZSTDLIB_STATIC_API)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(zstdwrap PRIVATE /MT)
|
target_compile_options(zstdwrap PRIVATE /MT)
|
||||||
else()
|
else()
|
||||||
target_link_options(zstdwrap PRIVATE -static)
|
target_link_options(zstdwrap PRIVATE -static)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(zstdwrap PRIVATE zstd)
|
target_link_libraries(zstdwrap PRIVATE libzstd_static)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set_target_properties(zstdwrap PROPERTIES PREFIX "")
|
set_target_properties(zstdwrap PROPERTIES PREFIX "")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user