From dc46fa754baa446d5428ba38db0d637a17b91c57 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Aug 2016 12:53:37 +0200 Subject: Add support for config.bin.{lib,exe}.{prefix,suffix} This replaces the bin.libprefix functionality. --- build2/cc/link.cxx | 18 +++++++++++------- build2/cc/module.cxx | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'build2/cc') 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 (l).c_str (); + if (auto l = t["bin.exe.suffix"]) s = cast (l).c_str (); + break; } case otype::a: @@ -681,8 +685,8 @@ namespace build2 e = "a"; } - if (auto l = t["bin.libprefix"]) - p = cast (l).c_str (); + if (auto l = t["bin.lib.prefix"]) p = cast (l).c_str (); + if (auto l = t["bin.lib.suffix"]) s = cast (l).c_str (); break; } @@ -710,14 +714,14 @@ namespace build2 e = "so"; } - if (auto l = t["bin.libprefix"]) - p = cast (l).c_str (); + if (auto l = t["bin.lib.prefix"]) p = cast (l).c_str (); + if (auto l = t["bin.lib.suffix"]) s = cast (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) { -- cgit v1.1