aboutsummaryrefslogtreecommitdiff
path: root/build/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-15 14:10:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-15 14:10:50 +0200
commit6535bf6175af32e2514faf75d2742424751a783b (patch)
tree21312b28ffe2bbb459a57e80a1f8eec498327d9f /build/cxx
parentad720fabd468974e3909f62a0f4e4e3cf0d03aef (diff)
New variables architecture
Now operator[] is only used for lookup.
Diffstat (limited to 'build/cxx')
-rw-r--r--build/cxx/module.cxx30
-rw-r--r--build/cxx/rule.cxx12
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.