aboutsummaryrefslogtreecommitdiff
path: root/build2/b.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-01 16:36:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:41 +0200
commite3e597180487328a54721e2afb95e33ed853d586 (patch)
tree89d59f482d41eb37a90f97b0dd55c2e878e4800b /build2/b.cxx
parent1dd17210b76d544a04fc6b4f3c98162ae9718102 (diff)
Pass const scope& where modification should not happen
Diffstat (limited to 'build2/b.cxx')
-rw-r--r--build2/b.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/build2/b.cxx b/build2/b.cxx
index 341554f..0ad404a 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -52,11 +52,21 @@ using namespace std;
#include <build2/install/init>
#include <build2/pkgconfig/init>
-using namespace build2;
+namespace build2
+{
+ int
+ main (int argc, char* argv[]);
+}
int
main (int argc, char* argv[])
{
+ return build2::main (argc, argv);
+}
+
+int build2::
+main (int argc, char* argv[])
+{
// This is a little hack to make out baseutils for Windows work when called
// with absolute path. In a nutshell, MSYS2's exec*p() doesn't search in the
// parent's executable directory, only in PATH. And since we are running
@@ -563,7 +573,7 @@ main (int argc, char* argv[])
// be of use to the bootstrap files (other than src-root.build,
// which, BTW, doesn't need to exist if src_root == out_root).
//
- scope& rs (create_root (out_root, src_root));
+ scope& rs (create_root (*scope::global_, out_root, src_root));
bool bootstrapped (build2::bootstrapped (rs));
@@ -980,7 +990,7 @@ main (int argc, char* argv[])
// building before we know how to for all the targets in this
// operation batch.
//
- scope& bs (scopes.find (ts.out_base));
+ const scope& bs (scopes.find (ts.out_base));
// Find the target type and extract the extension.
//