Skip to content

Commit

Permalink
Only include pqxx lib in main when apidb is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Woazboat committed Nov 28, 2023
1 parent a583819 commit 5baca88
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#if ENABLE_APIDB
#include <pqxx/pqxx>
#endif
#include <iostream>
#include <sstream>

Expand Down Expand Up @@ -395,6 +397,8 @@ int main(int argc, char **argv) {
} catch (const po::error & e) {
std::cerr << "Error: " << e.what() << "\n(\"openstreetmap-cgimap --help\" for help)" << std::endl;
return 1;

#if ENABLE_APIDB
} catch (const pqxx::sql_error &er) {
// Catch-all for query related postgres exceptions
std::cerr << "Error: " << er.what() << std::endl
Expand All @@ -408,6 +412,7 @@ int main(int argc, char **argv) {
std::cerr << "Error: " << e.base().what() << std::endl;
return 1;

#endif
#endif

} catch (const std::exception &e) {
Expand Down

0 comments on commit 5baca88

Please sign in to comment.