Skip to content

Commit

Permalink
Add option to build as static library
Browse files Browse the repository at this point in the history
  • Loading branch information
3dJan committed Mar 4, 2024
1 parent 12f34f7 commit 0f3ab86
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option(USE_INCLUDED_SSL "Use included libressl" ON)
option(BUILD_FOR_CODECOVERAGE "Build for code coverage analysis" OFF)
option(STRIP_BINARIES "Strip binaries (on non-apple)" ON)
option(USE_PLATFORM_UUID "Use UUID geneator that is provided by the OS (always ON for Windows)" OFF)
option(BUILD_AS_STATIC_LIB "Build as static lib (default=OFF)" OFF)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
Expand Down Expand Up @@ -108,10 +109,18 @@ endif()

#########################################################
# Shared library
add_library(${PROJECT_NAME} SHARED ${SRCS_COMMON} ${HDRS_COMMON}
${ACT_GENERATED_SOURCE}
${VERSION_FILES_OUTPUTLOCATION}
if (BUILD_AS_STATIC_LIB)
add_library(${PROJECT_NAME} STATIC ${SRCS_COMMON} ${HDRS_COMMON}
${ACT_GENERATED_SOURCE}
${VERSION_FILES_OUTPUTLOCATION}
)
else()
add_library(${PROJECT_NAME} SHARED ${SRCS_COMMON} ${HDRS_COMMON}
${ACT_GENERATED_SOURCE}
${VERSION_FILES_OUTPUTLOCATION}
)
endif()

SOURCE_GROUP("Source Files\\Autogenerated" FILES ${ACT_GENERATED_SOURCE})


Expand Down

0 comments on commit 0f3ab86

Please sign in to comment.