Skip to content

Commit

Permalink
Correctly detect static builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferroin committed May 8, 2024
1 parent 907f331 commit 07312a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,20 @@ project(netdata
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/packaging/cmake/Modules")
include(CMakeDependentOption)

if(NOT BUILD_SHARED_LIBS)
if(DEFINED BUILD_SHARED_LIBS)
if(NOT BUILD_SHARED_LIBS)
set(STATIC_BUILD TRUE)
endif()
endif()

if(STATIC_BUILD)
set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_STATIC_LIBRARY_PREFIX}")
set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()

find_package(PkgConfig REQUIRED)

if(NOT BUILD_SHARED_LIBS)
if(STATIC_BUILD)
list(APPEND PKG_CONFIG_EXECUTABLE "--static")
endif()

Expand Down

0 comments on commit 07312a3

Please sign in to comment.