From ad22be41719e29b075d707eb964fee1c4c30cf77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 25 Nov 2016 09:21:27 +0100 Subject: Do not fail to build if litesql is not there --- src/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 072345f..060372b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,7 +12,9 @@ #include #include -#include +#ifdef USE_DATABASE +# include +#endif #include @@ -85,11 +87,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, -- cgit v1.2.3