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.
24 lines
392 B
CMake
24 lines
392 B
CMake
add_library(maxbase STATIC
|
|
atomic.cc
|
|
eventcount.cc
|
|
format.cc
|
|
log.cc
|
|
logger.cc
|
|
maxbase.cc
|
|
messagequeue.cc
|
|
semaphore.cc
|
|
stopwatch.cc
|
|
string.cc
|
|
stacktrace.cc
|
|
worker.cc
|
|
workertask.cc
|
|
average.cc
|
|
)
|
|
|
|
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)
|