From de8e93420527598bbf2c96ef44f74e3856c65c3b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Aug 2017 12:03:30 +0200 Subject: Check for preprocessed value on source, not output target --- build2/cc/compile.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 1db827d..491b9f5 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -802,7 +802,9 @@ namespace build2 // This determines which of the following steps we perform and on // what source (original or preprocessed). // - if (const string* v = cast_null (t[x_preprocessed])) + // Note: must be set of the src target. + // + if (const string* v = cast_null (src[x_preprocessed])) try { md.pp = to_preprocessed (*v); @@ -810,7 +812,7 @@ namespace build2 catch (const invalid_argument& e) { fail << "invalid " << x_preprocessed.name << " variable value " - << "for target " << t << ": " << e; + << "for target " << src << ": " << e; } // If we have no #include directives, then skip header dependency -- cgit v1.1