aboutsummaryrefslogtreecommitdiff
path: root/build/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-20 15:34:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-20 15:34:16 +0200
commit4c44c914d898af53152addad5530504548175e85 (patch)
treef319c76b681e44874f887bfb5d085d59aa1e662d /build/cxx
parenta82cdb8fd9ba02034d296769772cdf81244da66a (diff)
Merge config.cxx.* variables into cxx.* when loading cxx module
Diffstat (limited to 'build/cxx')
-rw-r--r--build/cxx/module.cxx10
-rw-r--r--build/cxx/rule.cxx17
2 files changed, 13 insertions, 14 deletions
diff --git a/build/cxx/module.cxx b/build/cxx/module.cxx
index 846e324..3e0101f 100644
--- a/build/cxx/module.cxx
+++ b/build/cxx/module.cxx
@@ -108,6 +108,8 @@ namespace build
// is important to distinguish between the "configured as
// unspecified" and "not configured" cases).
//
+ // We also merge them into the corresponding cxx.* variables.
+ //
{
auto v (root["config.cxx.poptions"]);
@@ -115,6 +117,8 @@ namespace build
{
if (v.belongs (*global_scope))
root.assign ("config.cxx.poptions") = v;
+
+ root.append ("cxx.poptions") += v;
}
else
root.assign ("config.cxx.poptions") = nullptr;
@@ -127,6 +131,8 @@ namespace build
{
if (v.belongs (*global_scope))
root.assign ("config.cxx.coptions") = v;
+
+ root.append ("cxx.coptions") += v;
}
else
root.assign ("config.cxx.coptions") = nullptr;
@@ -139,6 +145,8 @@ namespace build
{
if (v.belongs (*global_scope))
root.assign ("config.cxx.loptions") = v;
+
+ root.append ("cxx.loptions") += v;
}
else
root.assign ("config.cxx.loptions") = nullptr;
@@ -151,6 +159,8 @@ namespace build
{
if (v.belongs (*global_scope))
root.assign ("config.cxx.libs") = v;
+
+ root.append ("cxx.libs") += v;
}
else
root.assign ("config.cxx.libs") = nullptr;
diff --git a/build/cxx/rule.cxx b/build/cxx/rule.cxx
index 963ecb1..65616f8 100644
--- a/build/cxx/rule.cxx
+++ b/build/cxx/rule.cxx
@@ -203,19 +203,16 @@ namespace build
vector<const char*> args {cxx.c_str ()};
- append_options (args, rs, "config.cxx.poptions");
append_options (args, t, "cxx.poptions");
// @@ Some C++ options (e.g., -std, -m) affect the preprocessor.
// Or maybe they are not C++ options? Common options?
//
- append_options (args, rs, "config.cxx.coptions");
+ append_options (args, t, "cxx.coptions");
string std; // Storage.
append_std (args, t, std);
- append_options (args, t, "cxx.coptions");
-
if (t.is_a<objso> ())
args.push_back ("-fPIC");
@@ -362,16 +359,12 @@ namespace build
vector<const char*> args {cxx.c_str ()};
- append_options (args, rs, "config.cxx.poptions");
append_options (args, t, "cxx.poptions");
-
- append_options (args, rs, "config.cxx.coptions");
+ append_options (args, t, "cxx.coptions");
string std; // Storage.
append_std (args, t, std);
- append_options (args, t, "cxx.coptions");
-
if (t.is_a<objso> ())
args.push_back ("-fPIC");
@@ -717,20 +710,17 @@ namespace build
vector<const char*> args {cxx.c_str ()};
- append_options (args, rs, "config.cxx.coptions");
+ append_options (args, t, "cxx.coptions");
string std; // Storage.
append_std (args, t, std);
- append_options (args, t, "cxx.coptions");
-
if (so)
args.push_back ("-shared");
args.push_back ("-o");
args.push_back (relt.string ().c_str ());
- append_options (args, rs, "config.cxx.loptions");
append_options (args, t, "cxx.loptions");
for (target* pt: t.prerequisites)
@@ -753,7 +743,6 @@ namespace build
args.push_back (relo.back ().string ().c_str ());
}
- append_options (args, rs, "config.cxx.libs");
append_options (args, t, "cxx.libs");
args.push_back (nullptr);