aboutsummaryrefslogtreecommitdiff
path: root/build/b.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-08 14:40:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-08 14:40:15 +0200
commit650d61845b3f61e9596a8a2dc97458998ba26013 (patch)
treeb0ce0b66bfd053ffb38849589404957cde0f12dc /build/b.cxx
parent402bb6e6b297614226c4f848ebdb13fd49a95d76 (diff)
Implement automatic amalgamation discovery
Diffstat (limited to 'build/b.cxx')
-rw-r--r--build/b.cxx38
1 files changed, 1 insertions, 37 deletions
diff --git a/build/b.cxx b/build/b.cxx
index 0291729..1650a73 100644
--- a/build/b.cxx
+++ b/build/b.cxx
@@ -40,42 +40,6 @@
using namespace std;
-namespace build
-{
- // Given an src_base directory, look for the project's src_root
- // based on the presence of known special files. Return empty
- // path if not found.
- //
- dir_path
- find_src_root (const dir_path& b)
- {
- for (dir_path d (b); !d.root () && d != home; d = d.directory ())
- {
- if (is_src_root (d))
- return d;
- }
-
- return dir_path ();
- }
-
- // The same but for out. Note that we also check whether a
- // directory happens to be src_root, in case this is an in-
- // tree build.
- //
- dir_path
- find_out_root (const dir_path& b, bool& src)
- {
- for (dir_path d (b); !d.root () && d != home; d = d.directory ())
- {
- if ((src = is_src_root (d)) || is_out_root (d))
- return d;
- }
-
- src = false;
- return dir_path ();
- }
-}
-
#include <build/config/module>
#include <build/bin/module>
#include <build/cxx/module>
@@ -359,7 +323,7 @@ main (int argc, char* argv[])
// If no src_base was explicitly specified, search for out_root.
//
bool src;
- out_root = find_out_root (out_base, src);
+ out_root = find_out_root (out_base, &src);
// If not found (i.e., we have no idea where the roots are),
// then this can mean two things: an in-tree build of a