From a5949f9e974171144dba84771a9f305f9e1dcc3f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jan 2016 13:59:51 +0200 Subject: Rework default extension derivation, again --- build2/search.cxx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'build2/search.cxx') diff --git a/build2/search.cxx b/build2/search.cxx index 2ab3d1f..3df8877 100644 --- a/build2/search.cxx +++ b/build2/search.cxx @@ -71,20 +71,18 @@ namespace build2 { if (auto f = ctk.type->extension) { - ext = &f (ctk, *cpk.scope); // Already from the pool. + ext = f (ctk, *cpk.scope); // Already from the pool. } - else + + if (ext == nullptr) { // What should we do here, fail or say we didn't find anything? - // Current think is that if the target type didn't provide the - // default extension, then it doesn't want us to search for an - // existing file (of course, if the user specified the extension - // explicitly, we will still do so). But let me know what you - // think. + // Current think is that if the target type couldn't find the default + // extension, then we simply shouldn't search for any existing files + // (of course, if the user specified the extension explicitly, we will + // still do so). // - //fail << "no default extension for prerequisite " << cpk; - level4 ([&]{trace << "no existing file found for prerequisite " - << cpk;}); + level4 ([&]{trace << "no existing file for prerequisite " << cpk;}); return nullptr; } } @@ -134,7 +132,7 @@ namespace build2 return &t; } - level4 ([&]{trace << "no existing file found for prerequisite " << cpk;}); + level4 ([&]{trace << "no existing file for prerequisite " << cpk;}); return nullptr; } -- cgit v1.1