From 166849d60c91093fb84a3d6c3402a6e3768addff Mon Sep 17 00:00:00 2001 From: Marty McFadden Date: Fri, 1 Dec 2023 02:19:28 -0800 Subject: [PATCH] Obey BUILD_SHARED_LIBS settings The new axl_service executable will know pick the correct external libraries based upon the BUILD_SHARED_LIBS settings. --- src/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 51aa22f..dad683a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 $ $) INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/axl_service DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) ENDIF(HAVE_PTHREADS)