From 4a853594b0a27dca6576c64d7bb8e6f9340b066f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 6 Aug 2017 14:23:38 +0200 Subject: Filter out warning as error options during preprocessing --- build2/utility.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'build2/utility.cxx') diff --git a/build2/utility.cxx b/build2/utility.cxx index b0325fb..36f8a4d 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -266,17 +266,17 @@ namespace build2 const dir_path empty_dir_path; void - append_options (cstrings& args, const lookup& l) + append_options (cstrings& args, const lookup& l, const char* e) { if (l) - append_options (args, cast (l)); + append_options (args, cast (l), e); } void - append_options (strings& args, const lookup& l) + append_options (strings& args, const lookup& l, const char* e) { if (l) - append_options (args, cast (l)); + append_options (args, cast (l), e); } void @@ -287,26 +287,32 @@ namespace build2 } void - append_options (cstrings& args, const strings& sv, size_t n) + append_options (cstrings& args, const strings& sv, size_t n, const char* e) { if (n != 0) { args.reserve (args.size () + n); for (size_t i (0); i != n; ++i) - args.push_back (sv[i].c_str ()); + { + if (e == nullptr || e != sv[i]) + args.push_back (sv[i].c_str ()); + } } } void - append_options (strings& args, const strings& sv, size_t n) + append_options (strings& args, const strings& sv, size_t n, const char* e) { if (n != 0) { args.reserve (args.size () + n); for (size_t i (0); i != n; ++i) - args.push_back (sv[i]); + { + if (e == nullptr || e != sv[i]) + args.push_back (sv[i]); + } } } -- cgit v1.1