diff options
author | louiz’ <louiz@louiz.org> | 2018-06-08 19:13:00 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2018-07-03 20:29:15 +0200 |
commit | a5c12e1f0207173ff7cdf752f3f54565898c4160 (patch) | |
tree | 4739e1ee842532cd9887629c4992870c56c3fe13 /CMakeLists.txt | |
parent | 38dc895a9b29ca6b860bc3889da38d0ceb340c63 (diff) | |
download | biboumi-a5c12e1f0207173ff7cdf752f3f54565898c4160.tar.gz biboumi-a5c12e1f0207173ff7cdf752f3f54565898c4160.tar.bz2 biboumi-a5c12e1f0207173ff7cdf752f3f54565898c4160.tar.xz biboumi-a5c12e1f0207173ff7cdf752f3f54565898c4160.zip |
Don’t add_library(database) with an empty string, that’s not portable
Instead, don’t create the library at all if not needed.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index abfd334..7c09090 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,8 +218,6 @@ if(SQLITE3_FOUND OR PQ_FOUND) include_directories(database ${PQ_INCLUDE_DIRS}) endif() set(USE_DATABASE TRUE) -else() - add_library(database OBJECT "") endif() # @@ -235,8 +233,7 @@ add_executable(${PROJECT_NAME} src/main.cpp $<TARGET_OBJECTS:xmpp> $<TARGET_OBJECTS:bridge> $<TARGET_OBJECTS:irc> - $<TARGET_OBJECTS:identd> - $<TARGET_OBJECTS:database>) + $<TARGET_OBJECTS:identd>) ## test_suite file(GLOB source_tests @@ -249,9 +246,12 @@ add_executable(test_suite ${source_tests} $<TARGET_OBJECTS:xmpp> $<TARGET_OBJECTS:bridge> $<TARGET_OBJECTS:irc> - $<TARGET_OBJECTS:identd> - $<TARGET_OBJECTS:database>) + $<TARGET_OBJECTS:identd>) set_target_properties(test_suite PROPERTIES EXCLUDE_FROM_ALL TRUE) +if(USE_DATABASE) + target_link_libraries(${PROJECT_NAME} $<TARGET_OBJECTS:database>) + target_link_libraries(test_suite $<TARGET_OBJECTS:database>) +endif() # ## Link the executables with their libraries |