aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-05-30 10:23:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-05-30 10:23:27 +0200
commit49fd34cb82d8edae683526a5d9fdd3c86136e646 (patch)
treee5e21a1d451e813ae18033066002019998ba5b76 /build2/cc/module.cxx
parentac379d5c0a7d8a7382649f3988eb86474d5e4a13 (diff)
Rework C/C++ standard translation in preparation for experimental/modules
Also fix bug in clang-apple versioning.
Diffstat (limited to 'build2/cc/module.cxx')
-rw-r--r--build2/cc/module.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx
index 885d6c7..cdc45e5 100644
--- a/build2/cc/module.cxx
+++ b/build2/cc/module.cxx
@@ -118,10 +118,9 @@ namespace build2
}
}
- // Translate x_std value (if any) to the compiler option (if any).
+ // Translate x_std value (if any) to the compiler option(s) (if any).
//
- if (auto l = rs[x_std])
- tstd = translate_std (ci, rs, cast<string> (*l));
+ tstd = translate_std (ci, rs, cast_null<string> (rs[x_std]));
// Extract system library search paths from the compiler and determine
// additional system include search paths.
@@ -129,7 +128,7 @@ namespace build2
dir_paths lib_dirs;
dir_paths inc_dirs;
- if (ci.id.type == "msvc")
+ if (ci.id.value () == compiler_id::msvc)
lib_dirs = msvc_library_search_paths (ci.path, rs);
else
{
@@ -188,7 +187,9 @@ namespace build2
if (!tstd.empty ())
{
- dr << " std " << tstd << '\n';
+ dr << " std "; // One less space.
+ for (const string& o: tstd) dr << ' ' << o;
+ dr << '\n';
}
if (!ci.cc_pattern.empty ()) // bin_pattern printed by bin