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.
Set the default value of BUILD_SHARED_LIBS to ON.
  • Loading branch information
hefroy committed Sep 27, 2023
1 parent 29cb5c8 commit 968e406
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ message(STATUS "USE_FILE is set to value: ${USE_FILE}")
OPTION(USE_CONSOLE "Set to OFF to disable console logging" OFF )
message(STATUS "USE_CONSOLE is set to value: ${USE_CONSOLE}")

OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )
message(STATUS "BUILD_SHARED_LIBS is set to value: ${BUILD_SHARED_LIBS}")

SET(DEFAULT_SEND_TIMEOUT "5000" CACHE STRING "default send timeout")
message(STATUS "DEFAULT_SEND_TIMEOUT is set to value: ${DEFAULT_SEND_TIMEOUT} ms")

Expand Down Expand Up @@ -139,7 +142,7 @@ file (GLOB CommonAPI-SomeIP_SRC "src/CommonAPI/SomeIP/*.cpp")
list (SORT CommonAPI-SomeIP_SRC)

# CommonAPI
add_library (CommonAPI-SomeIP SHARED ${CommonAPI-SomeIP_SRC})
add_library (CommonAPI-SomeIP ${CommonAPI-SomeIP_SRC})
set_target_properties (CommonAPI-SomeIP PROPERTIES VERSION ${COMPONENT_VERSION} SOVERSION ${COMPONENT_VERSION})
target_link_libraries (CommonAPI-SomeIP CommonAPI ${VSOMEIP_LIBRARIES})

Expand Down

0 comments on commit 968e406

Please sign in to comment.