Introduce ZSTD_PROGRAMS_LINK_SHARED

The CMake variable ZSTD_PROGRAMS_LINK_SHARED indicactes wether or not to link the zstd programs dynamically or statically.
This commit is contained in:
0x123456789A 2019-10-29 14:31:02 +01:00 committed by GitHub
parent 5c0bdde922
commit 26ffc18634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,9 +124,13 @@ endif ()
#-----------------------------------------------------------------------------
add_subdirectory(lib)
option(ZSTD_PROGRAMS_LINK_SHARED "PROGRAMS LINK SHARED" OFF)
if (ZSTD_BUILD_PROGRAMS)
if (NOT ZSTD_BUILD_STATIC)
if (NOT ZSTD_BUILD_STATIC AND NOT ZSTD_PROGRAMS_LINK_SHARED)
message(SEND_ERROR "You need to build static library to build zstd CLI")
elseif(ZSTD_BUILD_STATIC AND ZSTD_PROGRAMS_LINK_SHARED)
message(SEND_ERROR "You need to build shared library to build zstd CLI")
endif ()
add_subdirectory(programs)