aboutsummaryrefslogtreecommitdiff
path: root/build2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-17 12:53:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-17 12:53:37 +0200
commitdc46fa754baa446d5428ba38db0d637a17b91c57 (patch)
tree55d0cac384babc4fbbd27bb1cd8837fca6187017 /build2/cc
parent136dc68a2704d50ccc7dee644e67f86a31b34f49 (diff)
Add support for config.bin.{lib,exe}.{prefix,suffix}
This replaces the bin.libprefix functionality.
Diffstat (limited to 'build2/cc')
-rw-r--r--build2/cc/link.cxx18
-rw-r--r--build2/cc/module.cxx2
2 files changed, 12 insertions, 8 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index 4bebc6f..df1fa7e 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -651,8 +651,9 @@ namespace build2
//
if (t.path ().empty ())
{
- const char* p (nullptr);
- const char* e (nullptr);
+ const char* p (nullptr); // Prefix.
+ const char* s (nullptr); // Suffix.
+ const char* e (nullptr); // Extension.
switch (lt)
{
@@ -663,6 +664,9 @@ namespace build2
else
e = "";
+ if (auto l = t["bin.exe.prefix"]) p = cast<string> (l).c_str ();
+ if (auto l = t["bin.exe.suffix"]) s = cast<string> (l).c_str ();
+
break;
}
case otype::a:
@@ -681,8 +685,8 @@ namespace build2
e = "a";
}
- if (auto l = t["bin.libprefix"])
- p = cast<string> (l).c_str ();
+ if (auto l = t["bin.lib.prefix"]) p = cast<string> (l).c_str ();
+ if (auto l = t["bin.lib.suffix"]) s = cast<string> (l).c_str ();
break;
}
@@ -710,14 +714,14 @@ namespace build2
e = "so";
}
- if (auto l = t["bin.libprefix"])
- p = cast<string> (l).c_str ();
+ if (auto l = t["bin.lib.prefix"]) p = cast<string> (l).c_str ();
+ if (auto l = t["bin.lib.suffix"]) s = cast<string> (l).c_str ();
break;
}
}
- t.derive_path (e, p);
+ t.derive_path (e, p, s);
}
// Add ad hoc group members.
diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx
index 74c07e2..ec7178b 100644
--- a/build2/cc/module.cxx
+++ b/build2/cc/module.cxx
@@ -61,7 +61,7 @@ namespace build2
// default value every time will be a waste. So try without a default
// first.
//
- auto p (config::required (r, config_x));
+ auto p (config::omitted (r, config_x));
if (p.first == nullptr)
{