aboutsummaryrefslogtreecommitdiff
path: root/odb/plugin.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-12 14:28:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-12 14:28:03 +0200
commitc0931400a1c5f02cf145c90fd7e34216836efd88 (patch)
tree5e13c5864e5f3c944a316f9189eb87976c8908c0 /odb/plugin.cxx
parentf01ad68661d62af62087b7b1ae29628f028e9eaa (diff)
Implement --output-name, --generate-schema-only, and --at-once options
Diffstat (limited to 'odb/plugin.cxx')
-rw-r--r--odb/plugin.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/odb/plugin.cxx b/odb/plugin.cxx
index 8920521..1d73b7f 100644
--- a/odb/plugin.cxx
+++ b/odb/plugin.cxx
@@ -37,7 +37,9 @@ typedef vector<path> paths;
int plugin_is_GPL_compatible;
auto_ptr<options const> options_;
paths profile_paths_;
-path file_; // File being compiled.
+path file_; // File being compiled.
+paths inputs_; // List of input files in at-once mode or just file_.
+
// A prefix of the _cpp_file struct. This struct is not part of the
// public interface so we have to resort to this technique (based on
@@ -136,7 +138,7 @@ gate_callback (void*, void*)
// Generate.
//
generator g;
- g.generate (*options_, f, *u, file_);
+ g.generate (*options_, f, *u, file_, inputs_);
}
catch (cutl::re::format const& e)
{
@@ -221,7 +223,14 @@ plugin_init (plugin_name_args* plugin_info, plugin_gcc_version*)
if (strcmp (a.key, "svc-file") == 0)
{
- file_ = path (v);
+ // First is the main file. Subsequent are inputs in the at-once
+ // mode.
+ //
+ if (file_.empty ())
+ file_ = path (v);
+ else
+ inputs_.push_back (path (v));
+
continue;
}
@@ -238,6 +247,9 @@ plugin_init (plugin_name_args* plugin_info, plugin_gcc_version*)
}
}
+ if (inputs_.empty ())
+ inputs_.push_back (file_);
+
// Two-phase options parsing, similar to the driver.
//
int argc (static_cast<int> (argv.size ()));