From c0931400a1c5f02cf145c90fd7e34216836efd88 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Sep 2012 14:28:03 +0200 Subject: Implement --output-name, --generate-schema-only, and --at-once options --- odb/plugin.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'odb/plugin.cxx') 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 paths; int plugin_is_GPL_compatible; auto_ptr 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 (argv.size ())); -- cgit v1.1