55 lines
1.7 KiB
Diff
55 lines
1.7 KiB
Diff
From e3730c5a40a9d4a098ae9fb9a3bd867803007da1 Mon Sep 17 00:00:00 2001
|
||
From: =?UTF-8?q?louiz=E2=80=99?= <louiz@louiz.org>
|
||
Date: Fri, 8 Jun 2018 19:13:00 +0200
|
||
Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20add=5Flibrary(database)=20with?=
|
||
=?UTF-8?q?=20an=20empty=20string,=20that=E2=80=99s=20not=20portable?=
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
Instead, don’t create the library at all if not needed.
|
||
---
|
||
CMakeLists.txt | 12 ++++++------
|
||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
index 1d57a0b..7539886 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
|
||
--
|
||
2.14.5
|
||
|