aboutsummaryrefslogtreecommitdiff
path: root/build/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-10 15:29:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-10 15:29:42 +0200
commit722cf9d345e38b6f5ff4ed538d1f68bc75b2ab51 (patch)
treec2a97aa7c5e54699fae778246187aa4b7ae8b32c /build/context.cxx
parent650d61845b3f61e9596a8a2dc97458998ba26013 (diff)
Implement automatic subproject discovery
Currently we only capture their directories without the project names. We will need project names when we hook import search into this.
Diffstat (limited to 'build/context.cxx')
-rw-r--r--build/context.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/context.cxx b/build/context.cxx
index d62be61..dce6967 100644
--- a/build/context.cxx
+++ b/build/context.cxx
@@ -105,6 +105,30 @@ namespace build
return ms;
}
+ fs_status<mkdir_status>
+ mkdir_p (const dir_path& d)
+ {
+ // We don't want to print the command if the directory already
+ // exists. This makes the below code a bit ugly.
+ //
+ mkdir_status ms;
+
+ try
+ {
+ ms = try_mkdir_p (d);
+ }
+ catch (const system_error& e)
+ {
+ text << "mkdir -p " << d;
+ fail << "unable to create directory " << d << ": " << e.what ();
+ }
+
+ if (ms == mkdir_status::success)
+ text << "mkdir -p " << d;
+
+ return ms;
+ }
+
dir_path
src_out (const dir_path& out, scope& s)
{