Build all remaining libraries as object libraries

This commit is contained in:
Gunnar Beutner 2018-01-17 14:59:02 +01:00
parent ead9baa0ef
commit e1134fd3d9
9 changed files with 18 additions and 13 deletions

View 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)

View 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>

View 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>
)

View 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>
)

View 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>

View 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

View 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

View 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

View 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