aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-30 09:30:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-30 10:00:35 +0200
commit3dea3352e4cd414f01ae3d3b2215d6b0f1348d32 (patch)
tree899581ab605700450c5ca40e32e1ff37b3e9212d
parentf89d2c16c1dad9b8d2f3b0e402a47e30521f5a69 (diff)
Remove backwards-compatibility kludges
-rw-r--r--build/root.build9
-rw-r--r--build2/bin/init.cxx3
-rw-r--r--build2/buildfile16
-rw-r--r--build2/cc/link.cxx3
-rw-r--r--build2/cli/init.cxx23
-rw-r--r--build2/context.cxx4
-rw-r--r--build2/dist/init.cxx15
-rw-r--r--build2/install/init.cxx2
8 files changed, 19 insertions, 56 deletions
diff --git a/build/root.build b/build/root.build
index 0851534..fd751bc 100644
--- a/build/root.build
+++ b/build/root.build
@@ -15,12 +15,5 @@ cxx.poptions =+ -I$out_root -I$src_root
# All exe{} in tests/ are, well, tests. Don't install them.
#
-tests/: test.exe = true # @@ BC
-
-#tests/exe{*}: test = true # @@ BC
-tests/:
-{
- exe{*}: test = true
-}
-
+tests/exe{*}: test = true
tests/: install = false
diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx
index 6a417e7..5a13a87 100644
--- a/build2/bin/init.cxx
+++ b/build2/bin/init.cxx
@@ -497,9 +497,6 @@ namespace build2
const path& ar (cast<path> (ap.first));
const path* ranlib (cast_null<path> (rp.first));
- if (ranlib != nullptr && ranlib->empty ()) // @@ BC LT [null].
- ranlib = nullptr;
-
ar_info ari (
guess_ar (ar, ranlib, fb ? dir_path (*pat) : dir_path ()));
diff --git a/build2/buildfile b/build2/buildfile
index f0b50cf..5fc3a89 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -79,27 +79,17 @@ pkgconfig/{hxx cxx}{ init } \
# Pass our compiler target to be used as build2 host.
#
-# obj{context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\"
-if ($__build2_greater_than_0_2_0_hack__ == "true")
-{
- var=cxx.target
-}
-else
-{
- var=cxx.host
-}
-
-obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET='"'$($var)'"'
+obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\"
# Load the cli module but only if it's available. This way a distribution
# that includes pre-generated files can be built without installing cli.
# This is also the reason why above we explicitly spelled out individual
# source files instead of using the cli.cxx{} group (it won't be there
-# unless the module is loaded).
+# unless the module is configured).
#
using? cli
-if! $cli.loaded
+if! $cli.configured
{
define cli: file
cli{*}: extension = cli
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index c363a10..72b4876 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -1014,9 +1014,6 @@ namespace build2
{
ranlib = rs["bin.ranlib.path"];
- if (ranlib && ranlib->empty ()) // @@ BC LT [null].
- ranlib = lookup ();
-
const char* rl (
ranlib
? cast<string> (rs["bin.ranlib.checksum"]).c_str ()
diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx
index f2a3e8c..b7a8434 100644
--- a/build2/cli/init.cxx
+++ b/build2/cli/init.cxx
@@ -251,20 +251,6 @@ namespace build2
if (!cast_false<bool> (bs["cxx.loaded"]))
fail (loc) << "cxx module must be loaded before cli";
- // Register target types.
- //
- // Note that we do it even if the module is unconfigured. Failed that,
- // writing a buildfile will be pretty hard (actually, a buildfile still
- // needs to be prepared that the module itself won't be found and loaded
- // by defining fallback target types). This will be a BC change.
- //
- {
- auto& t (bs.target_types);
-
- t.insert<cli> ();
- t.insert<cli_cxx> ();
- }
-
// Load cli.config.
//
if (!cast_false<bool> (bs["cli.config.loaded"]))
@@ -281,6 +267,15 @@ namespace build2
return false;
}
+ // Register target types.
+ //
+ {
+ auto& t (bs.target_types);
+
+ t.insert<cli> ();
+ t.insert<cli_cxx> ();
+ }
+
// Register our rules.
//
{
diff --git a/build2/context.cxx b/build2/context.cxx
index 0e05926..a3678dd 100644
--- a/build2/context.cxx
+++ b/build2/context.cxx
@@ -241,10 +241,6 @@ namespace build2
gs.assign<dir_path> ("build.work") = work;
gs.assign<dir_path> ("build.home") = home;
- // @@ BC
- //
- gs.assign<bool> ("__build2_greater_than_0_2_0_hack__") = true;
-
// Enter the version.
//
{
diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx
index 637a232..338f6c8 100644
--- a/build2/dist/init.cxx
+++ b/build2/dist/init.cxx
@@ -104,9 +104,7 @@ namespace build2
if (s)
{
- const value& cv (config::optional (r, "config.dist.root"));
-
- if (cv && !cv.empty ()) // @@ BC LT [null]
+ if (const value& cv = config::optional (r, "config.dist.root"))
v = cast<dir_path> (cv); // Strip abs_dir_path.
}
}
@@ -118,10 +116,9 @@ namespace build2
if (s)
{
- const value& cv (
- config::required (r, "config.dist.cmd", path ("install")).first);
-
- if (cv && !cv.empty ()) // @@ BC LT [null]
+ if (const value& cv = config::required (r,
+ "config.dist.cmd",
+ path ("install")).first)
v = cv;
}
}
@@ -133,9 +130,7 @@ namespace build2
if (s)
{
- const value& cv (config::optional (r, "config.dist.archives"));
-
- if (cv && !cv.empty ()) // @@ BC LT [null]
+ if (const value& cv = config::optional (r, "config.dist.archives"))
v = cv;
}
}
diff --git a/build2/install/init.cxx b/build2/install/init.cxx
index e301f08..bfe3c7c 100644
--- a/build2/install/init.cxx
+++ b/build2/install/init.cxx
@@ -80,7 +80,7 @@ namespace build2
if (spec)
{
- if (cv != nullptr && *cv && !cv->empty ()) // @@ BC LT [null]
+ if (cv != nullptr && *cv)
v = cast<T> (*cv); // Strip CT to T.
}
else