From c4fd274e6620a8756ace090ec4879476ea2e9fb6 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:04:18 +0800 Subject: [PATCH] feat: support static --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2a1bee..e2d0272 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ option(TILE_BUILD_TESTS "Build tests" OFF) option(TILE_BUILD_BENCHMARKS "Build tests" OFF) option(TILE_WITH_OPENSSL "Build with openssl" OFF) option(TILE_BUILD_SHARED "Build shared library" ON) -option(TILE_BUILD_STATIC "Build static library" ON) if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(TILE_BUILD_TESTS ON) @@ -226,7 +225,11 @@ if((NOT TILE_HAVE_GETIFADDRS) OR (NOT TILE_HAVE_FREEIFADDRS)) list(APPEND TILE_SRCS "tile/base/net/detail/android/ifaddrs.c") endif() -add_library(tile SHARED ${TILE_SRCS}) +if (TILE_BUILD_SHARED) + add_library(tile SHARED ${TILE_SRCS}) +else() + add_library(tile STATIC ${TILE_SRCS}) +endif() set_target_properties(tile PROPERTIES VERSION ${PROJECT_VERSION} target_precompile_headers(tile PUBLIC inja/inja.h) target_precompile_headers(tile PUBLIC inja/string_view.h)