summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-11-25 09:21:27 +0100
committerlouiz’ <louiz@louiz.org>2017-04-26 16:08:20 +0200
commit269f9e0daf7a54e0f2116c0e2173e763a3575556 (patch)
tree0feefcf0bd8f249ed617813df095e395c1c1ebad /src/main.cpp
parent1fe2b1566a1bb14fb74794d53a5db9cca68c98ec (diff)
downloadbiboumi-269f9e0daf7a54e0f2116c0e2173e763a3575556.tar.gz
biboumi-269f9e0daf7a54e0f2116c0e2173e763a3575556.tar.bz2
biboumi-269f9e0daf7a54e0f2116c0e2173e763a3575556.tar.xz
biboumi-269f9e0daf7a54e0f2116c0e2173e763a3575556.zip
Do not fail to build if litesql is not there
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 019dff0..488032d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,7 +12,9 @@
#include <atomic>
#include <signal.h>
-#include <litesql.hpp>
+#ifdef USE_DATABASE
+# include <litesql.hpp>
+#endif
// A flag set by the SIGINT signal handler.
static std::atomic<bool> stop(false);
@@ -83,11 +85,14 @@ int main(int ac, char** av)
if (hostname.empty())
return config_help("hostname");
+
+#ifdef USE_DATABASE
try {
- open_database();
- } catch (const litesql::DatabaseError&) {
- return 1;
- }
+ open_database();
+ } catch (const litesql::DatabaseError&) {
+ return 1;
+ }
+#endif
// Block the signals we want to manage. They will be unblocked only during
// the epoll_pwait or ppoll calls. This avoids some race conditions,