From c39378136e17f556608b3ea649f2ee9c92104670 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 22:29:41 +0200 Subject: Define a database-specific macro in odb compiler --- odb/odb.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/odb/odb.cxx b/odb/odb.cxx index b6f76a0..a99fd83 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -23,6 +23,12 @@ using namespace std; static string plugin_path (string const& driver); +static char const* const db_macro[] = +{ + "-DODB_MYSQL", + "-DODB_TRACER" +}; + int main (int argc, char* argv[]) { @@ -60,7 +66,6 @@ main (int argc, char* argv[]) args.push_back ("-x"); args.push_back ("c++"); args.push_back ("-S"); - args.push_back ("-DODB_COMPILER"); args.push_back ("-fplugin=" + plugin); // Parse driver options. @@ -223,6 +228,11 @@ main (int argc, char* argv[]) return 1; } + // Add ODB macros. + // + args.push_back ("-DODB_COMPILER"); + args.push_back (db_macro[ops.database ()]); + // Encode plugin options. // for (size_t i (0); i < end; ++i) -- cgit v1.1