From a4796d5b851dac4a546f89c282f65e320076eb10 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 27 Aug 2016 09:53:30 +0200 Subject: Clean up library export, make c and cxx modules project root only So now c and cxx modules can only be loaded in project root scope (normally root.build). Also, the c.std and cxx.std must now be set *before* loading the module to take effect. This means we won't be able to handle old buildfiles anymore but old versions of build2 should be able to handle new *.std placement. --- build2/cc/module | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'build2/cc/module') diff --git a/build2/cc/module b/build2/cc/module index bed7673..09f5e5a 100644 --- a/build2/cc/module +++ b/build2/cc/module @@ -21,6 +21,8 @@ namespace build2 { namespace cc { + struct compiler_info; + class config_module: public module_base, public virtual config_data { public: @@ -28,11 +30,22 @@ namespace build2 config_module (config_data&& d) : config_data (move (d)) {} void - init (scope&, - scope&, - const location&, - bool first, - const variable_map&); + init (scope&, const location&, const variable_map&); + + // Translate the x.std value to the standard-selecting option if there + // is any. + // + virtual string + translate_std (const compiler_info&, scope&, const string&) const = 0; + + string tstd; + + private: + dir_paths + gcc_library_search_paths (process_path&, scope&) const; // gcc.cxx + + dir_paths + msvc_library_search_paths (process_path&, scope&) const; // msvc.cxx }; class module: public module_base, protected virtual common, @@ -47,11 +60,7 @@ namespace build2 install (move (d), *this) {} void - init (scope&, - scope&, - const location&, - bool first, - const variable_map&); + init (scope&, const location&, const variable_map&); }; } } -- cgit v1.1