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
Woazboat committed Nov 28, 2023
1 parent b613236 commit b4677c6
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>

@@ -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
@@ -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) {

0 comments on commit b4677c6

Please sign in to comment.