Skip to content

Commit

Permalink
Obey BUILD_SHARED_LIBS settings
Browse files Browse the repository at this point in the history
The new axl_service executable will know pick the correct external libraries based upon the BUILD_SHARED_LIBS settings.
  • Loading branch information
mcfadden8 committed Dec 1, 2023
1 parent fae47b0 commit 166849d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ IF(HAVE_PTHREADS)
axl_service_client.c
)
ADD_EXECUTABLE(axl_service axl_service_server.c)
TARGET_LINK_LIBRARIES(axl_service PUBLIC axl_static_o ${AXL_EXTERNAL_LIBS})

if(BUILD_SHARED_LIBS)
TARGET_LINK_LIBRARIES(axl_service
PUBLIC axl_static_o ${AXL_EXTERNAL_LIBS})
else()
TARGET_LINK_LIBRARIES(axl_service
PUBLIC axl_static_o ${AXL_EXTERNAL_STATIC_LIBS})
endif()

TARGET_INCLUDE_DIRECTORIES(axl_service PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/axl_service DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
ENDIF(HAVE_PTHREADS)
Expand Down

0 comments on commit 166849d

Please sign in to comment.