aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-18 22:29:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-18 22:29:41 +0200
commitc39378136e17f556608b3ea649f2ee9c92104670 (patch)
tree929a9bea9d37c4d7e7dea21b26da9cc462b2ab25
parentf7adb8951f09538d879b82ba41c44f4314df4e2c (diff)
Define a database-specific macro in odb compiler
-rw-r--r--odb/odb.cxx12
1 files changed, 11 insertions, 1 deletions
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)