diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-08 16:09:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-08 16:09:31 +0200 |
commit | 5af9070fda0dba591264ed675920efcfd62e81bc (patch) | |
tree | 8331fc83572c4bcd93a06adfcb489877b9816153 /build/cxx/module.cxx | |
parent | 22a280a1f3f92c2e01ef192a4dda65e7ae957188 (diff) |
Distinguish between undefined and null variables
Diffstat (limited to 'build/cxx/module.cxx')
-rw-r--r-- | build/cxx/module.cxx | 60 |
1 files changed, 38 insertions, 22 deletions
diff --git a/build/cxx/module.cxx b/build/cxx/module.cxx index 2bfdc41..e29d311 100644 --- a/build/cxx/module.cxx +++ b/build/cxx/module.cxx @@ -104,41 +104,57 @@ namespace build // // These are optional so all we need to do is "import" them // into the root scope if they were specified on the command - // line and set them to empty if unspecified (the last part + // line and set them to NULL if unspecified (the last part // is important to distinguish between the "configured as - // undefined" and "not configured" cases). + // unspecified" and "not configured" cases). // - if (auto val = root["config.cxx.poptions"]) { - if (val.scope == global_scope) - root.variables["config.cxx.poptions"] = val; + auto v (root["config.cxx.poptions"]); + + if (v.defined ()) + { + if (v.scope == global_scope) + root.variables["config.cxx.poptions"] = v; + } + else + root.variables["config.cxx.poptions"]; // Set to NULL. } - else - root.variables["config.cxx.poptions"]; // Undefined. - if (auto val = root["config.cxx.coptions"]) { - if (val.scope == global_scope) - root.variables["config.cxx.coptions"] = val; + auto v (root["config.cxx.coptions"]); + + if (v.defined ()) + { + if (v.scope == global_scope) + root.variables["config.cxx.coptions"] = v; + } + else + root.variables["config.cxx.coptions"]; // Set to NULL. } - else - root.variables["config.cxx.coptions"]; // Undefined. - if (auto val = root["config.cxx.loptions"]) { - if (val.scope == global_scope) - root.variables["config.cxx.loptions"] = val; + auto v (root["config.cxx.loptions"]); + + if (v.defined ()) + { + if (v.scope == global_scope) + root.variables["config.cxx.loptions"] = v; + } + else + root.variables["config.cxx.loptions"]; // Set to NULL. } - else - root.variables["config.cxx.loptions"]; // Undefined. - if (auto val = root["config.cxx.libs"]) { - if (val.scope == global_scope) - root.variables["config.cxx.libs"] = val; + auto v (root["config.cxx.libs"]); + + if (v.defined ()) + { + if (v.scope == global_scope) + root.variables["config.cxx.libs"] = v; + } + else + root.variables["config.cxx.libs"]; // Set to NULL. } - else - root.variables["config.cxx.libs"]; // Undefined. } } } |