]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Introduce ZSTD_PROGRAMS_LINK_SHARED
author0x123456789A <57141050+0x123456789A@users.noreply.github.com>
Tue, 29 Oct 2019 13:31:02 +0000 (14:31 +0100)
committerGitHub <noreply@github.com>
Tue, 29 Oct 2019 13:31:02 +0000 (14:31 +0100)
The CMake variable ZSTD_PROGRAMS_LINK_SHARED indicactes wether or not to link the zstd programs dynamically or statically.

build/cmake/CMakeLists.txt

index 33c05aee8569894728b87f8067ed6fbfe5a07a5b..41fdf787ff28aa855846fc912884e900be6a8251 100644 (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)