From f599f30ee51c8a6f796d5b9a35e8e17ee54333ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Mar 2019 09:03:33 +0200 Subject: Add support for alternative build file/directory naming scheme Specifically, the bdep-new --type|-t now has the new 'alt-naming' sub-option that can be used to create projects with the alternative naming. --- bdep/sync.cxx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'bdep/sync.cxx') diff --git a/bdep/sync.cxx b/bdep/sync.cxx index d4f3983..f8df4dc 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -402,17 +402,29 @@ namespace bdep } // We could run 'b info' and used the 'forwarded' value but this is - // both faster and simpler. + // both faster and simpler. Or at least it was until we got the + // alternative naming scheme. // - path f (src / "build" / "bootstrap" / "out-root.build"); - bool e (exists (f)); + auto check = [&src] () + { + path f (src / "build2" / "bootstrap" / "out-root.build2"); + bool e (exists (f)); + + if (!e) + { + f = src / "build" / "bootstrap" / "out-root.build"; + e = exists (f); + } + + return e; + }; const char* o (nullptr); if (prj.config->forward) { bool changed (true); - if (changed || !e) + if (changed || !check ()) o = "configure:"; } else if (!prj.implicit) // Requires explicit sync. @@ -421,7 +433,7 @@ namespace bdep // Looks like we will need to test that the forward is to this // config. 'b info' here we come? - //if (e) + //if (check ()) // o = "disfigure:"; } -- cgit v1.1