MXS-2057 Do not require systemd libraries

Exclude systemd usage if the library is not installed.
Only excluding what is necessary. This keeps the object size the
same and still compiles most of the code.
This commit is contained in:
Niclas Antti
2018-11-09 14:28:11 +02:00
parent f29e5b65de
commit 1108132cbd
4 changed files with 17 additions and 4 deletions

View File

@ -15,9 +15,9 @@ add_library(maxbase STATIC
average.cc
)
target_link_libraries(maxbase
systemd
)
if(HAVE_SYSTEMD)
target_link_libraries(maxbase systemd)
endif()
set_target_properties(maxbase PROPERTIES VERSION "1.0.0" LINK_FLAGS -Wl,-z,defs)
add_subdirectory(test)