diff options
-rw-r--r-- | odb/options.cli | 6 | ||||
-rw-r--r-- | odb/plugin.cxx | 17 |
2 files changed, 11 insertions, 12 deletions
diff --git a/odb/options.cli b/odb/options.cli index 9be8198..562daa6 100644 --- a/odb/options.cli +++ b/odb/options.cli @@ -343,10 +343,4 @@ class options database-default engine, pass \cb{default} as the value for this option." }; - - // - // Undocumented options that are used to pass service information - // between the frontend and the plugin. - // - std::string --svc-file; }; diff --git a/odb/plugin.cxx b/odb/plugin.cxx index a611dfe..47a524d 100644 --- a/odb/plugin.cxx +++ b/odb/plugin.cxx @@ -33,6 +33,7 @@ typedef vector<path> paths; int plugin_is_GPL_compatible; auto_ptr<options const> options_; paths profile_paths_; +path file_; // File being compiled. // 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 @@ -64,8 +65,7 @@ start_unit_callback (void*, void*) && fp->path == p // Our prefix corresponds to the actual type. && fp->dir_name == 0) // The directory part hasn't been initialized. { - path p (options_->svc_file ()); - path d (p.directory ()); + path d (file_.directory ()); char* s; if (d.empty ()) @@ -104,14 +104,13 @@ gate_callback (void*, void*) try { - path file (options_->svc_file ()); parser p (*options_, loc_pragmas_, decl_pragmas_); - auto_ptr<unit> u (p.parse (global_namespace, file)); + auto_ptr<unit> u (p.parse (global_namespace, file_)); // // validator v; - if (!v.validate (*options_, *u, file)) + if (!v.validate (*options_, *u, file_)) r = 1; // @@ -119,7 +118,7 @@ gate_callback (void*, void*) if (r == 0) { generator g; - g.generate (*options_, *u, file); + g.generate (*options_, *u, file_); } } catch (parser::failed const&) @@ -171,6 +170,12 @@ plugin_init (plugin_name_args* plugin_info, plugin_gcc_version*) continue; } + if (strcmp (a.key, "svc-file") == 0) + { + file_ = path (a.value); + continue; + } + string opt (strlen (a.key) > 1 ? "--" : "-"); opt += a.key; |