diff options
Diffstat (limited to 'build/cxx')
-rw-r--r-- | build/cxx/module.cxx | 30 | ||||
-rw-r--r-- | build/cxx/rule.cxx | 12 |
2 files changed, 16 insertions, 26 deletions
diff --git a/build/cxx/module.cxx b/build/cxx/module.cxx index 3c9a4b6..e5c71e7 100644 --- a/build/cxx/module.cxx +++ b/build/cxx/module.cxx @@ -49,8 +49,8 @@ namespace build if (val) { - if (val.scope != global_scope) - break; // A value from config.build. + if (!val.belongs (*global_scope)) + break; // A value from (some) config.build. v = val.as<const string&> (); } @@ -96,7 +96,7 @@ namespace build // Set on the project root. // - root.variables["config.cxx"] = move (v); + root.assign ("config.cxx") = move (v); } // config.cxx.{p,c,l}options @@ -113,11 +113,11 @@ namespace build if (v.defined ()) { - if (v.scope == global_scope) - root.variables["config.cxx.poptions"] = v; + if (v.belongs (*global_scope)) + root.assign ("config.cxx.poptions") = v; } else - root.variables["config.cxx.poptions"]; // Set to NULL. + root.assign ("config.cxx.poptions") = nullptr; } { @@ -125,11 +125,11 @@ namespace build if (v.defined ()) { - if (v.scope == global_scope) - root.variables["config.cxx.coptions"] = v; + if (v.belongs (*global_scope)) + root.assign ("config.cxx.coptions") = v; } else - root.variables["config.cxx.coptions"]; // Set to NULL. + root.assign ("config.cxx.coptions") = nullptr; } { @@ -137,11 +137,11 @@ namespace build if (v.defined ()) { - if (v.scope == global_scope) - root.variables["config.cxx.loptions"] = v; + if (v.belongs (*global_scope)) + root.assign ("config.cxx.loptions") = v; } else - root.variables["config.cxx.loptions"]; // Set to NULL. + root.assign ("config.cxx.loptions") = nullptr; } { @@ -149,11 +149,11 @@ namespace build if (v.defined ()) { - if (v.scope == global_scope) - root.variables["config.cxx.libs"] = v; + if (v.belongs (*global_scope)) + root.assign ("config.cxx.libs") = v; } else - root.variables["config.cxx.libs"]; // Set to NULL. + root.assign ("config.cxx.libs") = nullptr; } } } diff --git a/build/cxx/rule.cxx b/build/cxx/rule.cxx index a7ec2a6..bc105cf 100644 --- a/build/cxx/rule.cxx +++ b/build/cxx/rule.cxx @@ -576,17 +576,7 @@ namespace build // Set the -fPIC option if we are building a shared object. // if (so) - { - auto var (ot.variables["cxx.coptions"]); - - if (!var) - { - if (auto var1 = ot.base_scope ()["cxx.coptions"]) - var = var1; - } - - var += "-fPIC"; - } + ot.append ("cxx.coptions") += "-fPIC"; // If this target already exists, then it needs to be "compatible" // with what we are doing here. |