From 1845141809aa91b03718066a6f46863885a6a887 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Mar 2019 09:06:37 +0200 Subject: Add support for alternative build file/directory naming scheme Now the build/*.build, buildfile, and .buildignore filesystem entries in a project can alternatively (but consistently) be called build2/*.build2, build2file, and .build2ignore. See a note at the beginning of the Project Structure section in the manual for details (motivation, restrictions, etc). --- build2/target-key.hxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'build2/target-key.hxx') diff --git a/build2/target-key.hxx b/build2/target-key.hxx index 4877bbd..ed9a0ed 100644 --- a/build2/target-key.hxx +++ b/build2/target-key.hxx @@ -50,8 +50,16 @@ namespace build2 return !x.ext || !y.ext || *x.ext == *y.ext; else { - const char* xe (x.ext ? x.ext->c_str () : tt.fixed_extension (x)); - const char* ye (y.ext ? y.ext->c_str () : tt.fixed_extension (y)); + // Note that for performance reasons here we use the specified extension + // without calling fixed_extension(). + // + const char* xe (x.ext + ? x.ext->c_str () + : tt.fixed_extension (x, nullptr /* root scope */)); + + const char* ye (y.ext + ? y.ext->c_str () + : tt.fixed_extension (y, nullptr /* root scope */)); return strcmp (xe, ye) == 0; } -- cgit v1.1