Skip to content

Commit

Permalink
Allow static libs
Browse files Browse the repository at this point in the history
- Remove SHARED option from add_library to allow static libs,
  CMake then respects the standard BUILD_SHARED_LIBS option.
  • Loading branch information
hefroy committed Oct 21, 2024
1 parent 0e1d97e commit b0194fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ link_directories(

file(GLOB CAPI_SRCS "src/CommonAPI/*.cpp")
list(SORT CAPI_SRCS)
add_library(CommonAPI SHARED ${CAPI_SRCS})
add_library(CommonAPI ${CAPI_SRCS})
target_link_libraries(CommonAPI PRIVATE ${DL_LIBRARY} ${DLT_LIBRARIES})
set_target_properties(CommonAPI PROPERTIES VERSION ${LIBCOMMONAPI_MAJOR_VERSION}.${LIBCOMMONAPI_MINOR_VERSION}.${LIBCOMMONAPI_PATCH_VERSION} SOVERSION ${LIBCOMMONAPI_MAJOR_VERSION}.${LIBCOMMONAPI_MINOR_VERSION}.${LIBCOMMONAPI_PATCH_VERSION} LINKER_LANGUAGE C)
target_include_directories(CommonAPI INTERFACE
Expand Down

0 comments on commit b0194fa

Please sign in to comment.