diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-09-07 18:09:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-09-07 18:09:44 +0200 |
commit | e2ba7fa123213fcc5673119b8d993d7967a1fb24 (patch) | |
tree | 22b545150af90ec2831a2665afbac9b19828e65f /build2/cc/module.hxx | |
parent | d01c30fa81a849ea7545b8235656eb1dcbba877b (diff) |
Implement {c,cxx}.guess modules
These can be loaded before {c,cxx} to guess the compiler. Based on this
information we can then choose the standard, experimental features, etc.
For example:
using cxx.guess
if ($cxx.id == 'clang')
cxx.features.modules = false
cxx.std = experimental
using cxx
Diffstat (limited to 'build2/cc/module.hxx')
-rw-r--r-- | build2/cc/module.hxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/build2/cc/module.hxx b/build2/cc/module.hxx index c34b0e5..08f573b 100644 --- a/build2/cc/module.hxx +++ b/build2/cc/module.hxx @@ -29,6 +29,15 @@ namespace build2 explicit config_module (config_data&& d) : config_data (move (d)) {} + // We split the configuration process into into two parts: guessing the + // compiler information and the actual configuration. This allows one to + // adjust configuration (say the standard or enabled experimental + // features) base on the compiler information by first loading the + // guess module. + // + void + guess (scope&, const location&, const variable_map&); + void init (scope&, const location&, const variable_map&); @@ -40,8 +49,7 @@ namespace build2 translate_std (const compiler_info&, scope&, const string*) const = 0; strings tstd; - - compiler_id::value_type cid; + compiler_info ci; // Note: some members are moved from. private: dir_paths @@ -49,6 +57,9 @@ namespace build2 dir_paths msvc_library_search_paths (process_path&, scope&) const; // msvc.cxx + + private: + bool new_; // See guess() and init() for details. }; class module: public module_base, public virtual common, |