From d28970114e5807f57ae339764ac05384ef163379 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 1 Apr 2024 07:39:12 +0200 Subject: Add ~host-no-warnings and ~build2-no-warnings special configurations These are parallel to ~host and ~build2 but with suppressed C/C++ compiler warnings. Note also that the C++ ad hoc recipes are now by default built in ~build2-no-warnings instead of ~build2 unless the project is configured for development with config..develop=true. --- libbuild2/config/host-config.cxx.in | 3 +++ libbuild2/config/init.cxx | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'libbuild2/config') diff --git a/libbuild2/config/host-config.cxx.in b/libbuild2/config/host-config.cxx.in index 9e3e0c2..6b1ce77 100644 --- a/libbuild2/config/host-config.cxx.in +++ b/libbuild2/config/host-config.cxx.in @@ -9,5 +9,8 @@ namespace build2 // extern const char host_config[] = R"###($host_config$)###"; extern const char build2_config[] = R"###($build2_config$)###"; + + extern const char host_config_no_warnings[] = R"###($host_config_no_warnings$)###"; + extern const char build2_config_no_warnings[] = R"###($build2_config_no_warnings$)###"; } } diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx index 38590ae..d1a57b9 100644 --- a/libbuild2/config/init.cxx +++ b/libbuild2/config/init.cxx @@ -210,6 +210,9 @@ namespace build2 #ifndef BUILD2_BOOTSTRAP extern const char host_config[]; extern const char build2_config[]; + + extern const char host_config_no_warnings[]; + extern const char build2_config_no_warnings[]; #endif bool @@ -486,12 +489,19 @@ namespace build2 if (s[0] != '~') load_config_file (f, l); - else if (s == "~host" || s == "~build2") + else if (s == "~host" || s == "~host-no-warnings" || + s == "~build2" || s == "~build2-no-warnings") { #ifdef BUILD2_BOOTSTRAP assert (false); #else - istringstream is (s[1] == 'h' ? host_config : build2_config); + istringstream is (s[1] == 'h' + ? (s.size () == 5 + ? host_config + : host_config_no_warnings) + : (s.size () == 7 + ? build2_config + : build2_config_no_warnings)); load_config (is, path_name (s), l); #endif } -- cgit v1.1