From ba6db89e24aa84316372d59e6bba4ac88145b32a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 22 May 2021 19:45:51 +0200 Subject: [PATCH] Rakefile: improve filtering optimization flags for iso639_language_list.cpp The old regular expression did not filter out non-numeric optimization levels options such as `-Os`, nor did it filter the option out if it was at the end of the flags string. See 3105 for context. --- NEWS.md | 10 ++++++++++ Rakefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3890fe602..411854df4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# Version ? + +## Bug fixes + +* build system: fixed filtering out optimization options when compiling the + file `iso639_language_list.cpp` (before only numeric optimization levels + were filtered out and only if it wasn't the last option in the list of + flags). See #3105 for context. + + # Version 57.0.0 "Till The End" 2021-05-22 ## New features and enhancements diff --git a/Rakefile b/Rakefile index 8c9487436..ce564127e 100644 --- a/Rakefile +++ b/Rakefile @@ -355,7 +355,7 @@ cxx_compiler = lambda do |*args| # Even -O1 causes compilation time & memory usage to skyrocket, # possibly exponentially, with the number of entries to # emplace_back() into the vector. - flags.gsub!(%r{ -O\d+ }, ' -O0 ') + flags.gsub!(%r{(^| )-O[^ ]*}, ' -O0') end args = [