]> granicus.if.org Git - icinga2/commitdiff
Build all remaining libraries as object libraries 5998/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 17 Jan 2018 13:59:02 +0000 (14:59 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 17 Jan 2018 13:59:02 +0000 (14:59 +0100)
CMakeLists.txt
icinga-app/CMakeLists.txt
icinga-studio/CMakeLists.txt
plugins/CMakeLists.txt
test/CMakeLists.txt
third-party/execvpe/CMakeLists.txt
third-party/mmatch/CMakeLists.txt
third-party/socketpair/CMakeLists.txt
third-party/yajl/src/CMakeLists.txt

index 9d3fcd19c1879f56b99cd00f8f3a9447633024bd..8d5006d296e098c8bf259df2cf0a34a1b618178a 100644 (file)
@@ -123,12 +123,17 @@ include_directories(${Boost_INCLUDE_DIRS})
 find_package(OpenSSL REQUIRED)
 include_directories(${OPENSSL_INCLUDE_DIR})
 
+set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
+set(base_OBJS $<TARGET_OBJECTS:mmatch> $<TARGET_OBJECTS:socketpair> $<TARGET_OBJECTS:base>)
+
 find_package(YAJL)
 
 if(NOT YAJL_FOUND)
   include_directories(${icinga2_BINARY_DIR}/third-party/yajl/include)
   link_directories(${icinga2_BINARY_DIR}/third-party/yajl)
-  set(YAJL_LIBRARIES "yajl")
+  list(APPEND base_SOURCES $<TARGET_OBJECTS:yajl>)
+else()
+  list(APPEND base_DEPS ${YAJL_LIBRARIES})
 endif()
 
 find_package(Editline)
@@ -142,14 +147,12 @@ include_directories(
   ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/lib
 )
 
-set(base_DEPS ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${YAJL_LIBRARIES} mmatch socketpair)
-
 if(HAVE_LIBEXECINFO)
   list(APPEND base_DEPS execinfo)
 endif()
 
 if(UNIX OR CYGWIN)
-  list(APPEND base_DEPS execvpe)
+  list(APPEND base_OBJS $<TARGET_OBJECTS:execvpe>)
 endif()
 
 if(EDITLINE_FOUND)
index c599f2366c2ce5ef12b53a25c71452fb87dbf0ac..cc209ed753306df563e2103b56534c25707cc59b 100644 (file)
@@ -65,6 +65,8 @@ endif()
 
 add_executable(icinga-app
   $<TARGET_OBJECTS:icingaloader>
+  $<TARGET_OBJECTS:mmatch>
+  $<TARGET_OBJECTS:socketpair>
   $<TARGET_OBJECTS:base>
   $<TARGET_OBJECTS:config>
   $<TARGET_OBJECTS:remote>
index 475fa595a15042c61ffdfb4354a5fbab105b9e4c..2925ce95f2e7fda188703387078a36a524e83503 100644 (file)
@@ -32,7 +32,7 @@ set(icinga_studio_SOURCES
   connectform.cpp connectform.hpp
   mainform.cpp mainform.hpp
   icinga.icns ${WindowsSources}
-  $<TARGET_OBJECTS:base>
+  ${base_OBJS}
   $<TARGET_OBJECTS:config>
   $<TARGET_OBJECTS:remote>
 )
index 34f0786bebe7495807b71543ca89f8532357a509..5d1cc348f4cd81d17a72e8f6dacf4004af5f0b49 100644 (file)
@@ -17,7 +17,7 @@
 
 add_executable(check_nscp_api
   check_nscp_api.cpp
-  $<TARGET_OBJECTS:base>
+  ${base_OBJS}
   $<TARGET_OBJECTS:config>
   $<TARGET_OBJECTS:remote>
 )
index 8513cd6d220379d9aed073600ff25676750bf06e..0ceaefe8cdb120c3c34ecf68d08dc020b28aeb59 100644 (file)
@@ -44,7 +44,7 @@ set(base_test_SOURCES
   icinga-notification.cpp
   icinga-perfdata.cpp
   remote-url.cpp
-  $<TARGET_OBJECTS:base>
+  ${base_OBJS}
   $<TARGET_OBJECTS:config>
   $<TARGET_OBJECTS:remote>
   $<TARGET_OBJECTS:icinga>
@@ -146,7 +146,7 @@ if(ICINGA2_WITH_LIVESTATUS)
   set(livestatus_test_SOURCES
     livestatus-fixture.cpp
     livestatus.cpp
-    $<TARGET_OBJECTS:base>
+    ${base_OBJS}
     $<TARGET_OBJECTS:config>
     $<TARGET_OBJECTS:remote>
     $<TARGET_OBJECTS:icinga>
@@ -168,7 +168,7 @@ endif()
 set(icinga_checkable_test_SOURCES
   icinga-checkable-fixture.cpp
   icinga-checkable-flapping.cpp
-  $<TARGET_OBJECTS:base>
+  ${base_OBJS}
   $<TARGET_OBJECTS:config>
   $<TARGET_OBJECTS:remote>
   $<TARGET_OBJECTS:icinga>
index 9f52f8e151fe2b0677c7054241b759208c76d7ed..4be31bc1b617613d90619d0f1b76464acc398839 100644 (file)
@@ -19,7 +19,7 @@ set(execvpe_SOURCES
   execvpe.c execvpe.h
 )
 
-add_library(execvpe STATIC ${execvpe_SOURCES})
+add_library(execvpe OBJECT ${execvpe_SOURCES})
 
 set_target_properties (
   execvpe PROPERTIES
index 238cf2f511de7d48fce58f0c53e31f190a8b16ae..70bb6f1c20fc09e7493588945837da3f0b04a9bf 100644 (file)
@@ -19,7 +19,7 @@ set(mmatch_SOURCES
   mmatch.c mmatch.h
 )
 
-add_library(mmatch STATIC ${mmatch_SOURCES})
+add_library(mmatch OBJECT ${mmatch_SOURCES})
 
 set_target_properties(
   mmatch PROPERTIES
index fa2f39273836eadf64c921c380c15e82a09562e4..4983e3ed048f6ea71630973aad10229adfe23556 100644 (file)
@@ -19,7 +19,7 @@ set(socketpair_SOURCES
   socketpair.c socketpair.h
 )
 
-add_library(socketpair STATIC ${socketpair_SOURCES})
+add_library(socketpair OBJECT ${socketpair_SOURCES})
 
 set_target_properties (
   socketpair PROPERTIES
index 1ebf3686969e3f4dc07d8a9cea6e36403332b7c8..be277d1b3c594ccaecb0d9944522686df0029157 100644 (file)
@@ -30,7 +30,7 @@ ADD_DEFINITIONS(-DYAJL_BUILD)
 # set up some paths
 SET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../include/yajl)
 
-ADD_LIBRARY(yajl STATIC ${SRCS} ${HDRS} ${PUB_HDRS})
+ADD_LIBRARY(yajl OBJECT ${SRCS} ${HDRS} ${PUB_HDRS})
 
 #### setup shared library version number
 SET_TARGET_PROPERTIES(yajl