From 9b771dba3a9ae821a8f4359e4690555800087e98 Mon Sep 17 00:00:00 2001 From: gitlost Date: Mon, 30 Mar 2020 10:54:21 +0100 Subject: [PATCH] Make zint-static build optional --- CMakeLists.txt | 1 + backend/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baf93dc9..3d120f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) set(ZINT_DEBUG FALSE CACHE BOOL "Set debug compile flag") set(ZINT_SANITIZE FALSE CACHE BOOL "Set sanitize compile/link flags") set(ZINT_TEST FALSE CACHE BOOL "Set test compile flag") +set(ZINT_STATIC FALSE CACHE BOOL "Build static library") include (SetPaths.cmake) diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 98e6faa8..0649dcc2 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -18,7 +18,9 @@ else(PNG_FOUND) endif(PNG_FOUND) add_library(zint SHARED ${zint_SRCS}) -add_library(zint-static STATIC ${zint_SRCS}) +if(ZINT_STATIC) + add_library(zint-static STATIC ${zint_SRCS}) +endif(ZINT_STATIC) set_target_properties(zint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}" VERSION ${ZINT_VERSION})