aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/module
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-27 09:53:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-27 09:53:30 +0200
commita4796d5b851dac4a546f89c282f65e320076eb10 (patch)
tree584d8fb67dcf333aeb3ae155bb73cf7d230b3ac4 /build2/cc/module
parentf0edc0e2b67fa43c4e2410c7d3d8f1841d576749 (diff)
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.
Diffstat (limited to 'build2/cc/module')
-rw-r--r--build2/cc/module29
1 files changed, 19 insertions, 10 deletions
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&);
};
}
}