From 722cf9d345e38b6f5ff4ed538d1f68bc75b2ab51 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Jul 2015 15:29:42 +0200 Subject: 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. --- build/context.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'build/context.cxx') 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_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) { -- cgit v1.1