Skip to content

Commit

Permalink
Add options to to use static libs
Browse files Browse the repository at this point in the history
  • Loading branch information
fdr400 committed Jan 8, 2025
1 parent 134acba commit 32df506
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
-DCMAKE_CXX_COMPILER=clang++-18
-DCMAKE_C_COMPILER=clang-18
-DCMAKE_BUILD_TYPE=Debug
-DUSERVER_USE_STATIC_LIBS=1
-DUSERVER_SANITIZE="ub addr"
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
Expand All @@ -45,6 +46,7 @@ jobs:
-DCMAKE_CXX_COMPILER=clang++-14
-DCMAKE_C_COMPILER=clang-14
-DCMAKE_BUILD_TYPE=Debug
-DUSERVER_USE_STATIC_LIBS=1
-DUSERVER_SANITIZE="ub addr"
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
Expand Down Expand Up @@ -83,6 +85,7 @@ jobs:
-DCMAKE_CXX_COMPILER=g++-8
-DCMAKE_C_COMPILER=gcc-8
-DCMAKE_BUILD_TYPE=Debug
-DUSERVER_USE_LD=gold
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- cmake-flags: >-
-DCMAKE_CXX_STANDARD=17
-DCPM_SOURCE_CACHE=~/.cache/CPM
-DUSERVER_USE_STATIC_LIBS=1
-DUSERVER_USE_LD=gold
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_SAMPLES=1
Expand All @@ -32,6 +33,7 @@ jobs:
-DCMAKE_CXX_COMPILER=clang++-16
-DCMAKE_CXX_STANDARD=17
-DCPM_SOURCE_CACHE=~/.cache/CPM
-DUSERVER_USE_STATIC_LIBS=1
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
Expand Down Expand Up @@ -59,6 +61,7 @@ jobs:
-DCMAKE_CXX_COMPILER=clang++-16
-DCMAKE_CXX_STANDARD=20
-DCPM_SOURCE_CACHE=~/.cache/CPM
-DUSERVER_USE_STATIC_LIBS=1
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
Expand Down
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,15 @@ option(USERVER_FEATURE_OTLP "Provide asynchronous OTLP exporters" "${USERVER_LIB

set(CMAKE_DEBUG_POSTFIX d)

set(OPENSSL_USE_STATIC_LIBS ON)
set(ZLIB_USE_STATIC_LIBS ON)
set(Protobuf_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_LIBS ON)
set(CURL_USE_STATIC_LIBS ON)
set(Protobuf_VERBOSE ON)
option(USERVER_USE_STATIC_LIBS "Turns on dependencies <PackageName>_USE_STATIC_LIBS options" OFF)

if(USERVER_USE_STATIC_LIBS)
set(OPENSSL_USE_STATIC_LIBS ON)
set(ZLIB_USE_STATIC_LIBS ON)
set(Protobuf_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_LIBS ON)
set(CURL_USE_STATIC_LIBS ON)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(UserverSetupEnvironment)
Expand Down

0 comments on commit 32df506

Please sign in to comment.