From 7ce8c8dccc0c942cf7c9c42f044ed11fb6e0c619 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Wed, 29 Dec 2021 16:08:27 -0300 Subject: [PATCH] version 4795 --- modules/android.py | 21 +++++++++++++++++++++ modules/ios.py | 28 ++++++++++++++++++++++++++++ modules/wasm.py | 25 ++----------------------- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/modules/android.py b/modules/android.py index 093f745..8ed8cc6 100644 --- a/modules/android.py +++ b/modules/android.py @@ -72,6 +72,27 @@ def run_task_patch(): else: l.bullet("Skipped: build gn flags", l.PURPLE) + # compiler warning as error + source_file = os.path.join( + source_dir, + "build", + "config", + "compiler", + "compiler.gni", + ) + + line_content = "treat_warnings_as_errors = true" + line_number = f.get_file_line_number_with_content( + source_file, line_content, strip=True + ) + + if line_number: + content = " treat_warnings_as_errors = false" + f.set_file_line_content(source_file, line_number, content, new_line=True) + l.bullet("Applied: compiler warning as error", l.GREEN) + else: + l.bullet("Skipped: compiler warning as error", l.PURPLE) + l.ok() diff --git a/modules/ios.py b/modules/ios.py index b3647aa..a3ee2c8 100644 --- a/modules/ios.py +++ b/modules/ios.py @@ -312,6 +312,34 @@ def run_task_patch(): else: l.bullet("Skipped: core fxge", l.PURPLE) + # mllvm - 1 + source_file = os.path.join(source_dir, "build", "config", "compiler", "BUILD.gn") + + line_content = '"-mllvm",' + line_number = f.get_file_line_number_with_content( + source_file, line_content, strip=True + ) + + if line_number: + f.prepend_to_file_line_range(source_file, line_number, line_number + 1, "#") + l.bullet("Applied: mllvm - 1", l.GREEN) + else: + l.bullet("Skipped: mllvm - 1", l.PURPLE) + + # mllvm - 2 + source_file = os.path.join(source_dir, "build", "config", "compiler", "BUILD.gn") + + line_content = 'ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ]' + line_number = f.get_file_line_number_with_content( + source_file, line_content, strip=True + ) + + if line_number: + f.prepend_to_file_line(source_file, line_number, "#") + l.bullet("Applied: mllvm - 2", l.GREEN) + else: + l.bullet("Skipped: mllvm - 2", l.PURPLE) + # clang 12 source_file = os.path.join( source_dir, diff --git a/modules/wasm.py b/modules/wasm.py index 8dd3b1f..6341f7d 100644 --- a/modules/wasm.py +++ b/modules/wasm.py @@ -187,7 +187,7 @@ def run_task_patch(): "gcc_toolchain.gni", ) - line_content = 'cc = "$prefix/clang"' + line_content = 'cc = "${prefix}/clang"' line_number = f.get_file_line_number_with_content( source_file, line_content, strip=True ) @@ -207,7 +207,7 @@ def run_task_patch(): "gcc_toolchain.gni", ) - line_content = 'cxx = "$prefix/clang++"' + line_content = 'cxx = "${prefix}/clang++"' line_number = f.get_file_line_number_with_content( source_file, line_content, strip=True ) @@ -321,27 +321,6 @@ def run_task_patch(): else: l.bullet("Skipped: skia pthread", l.PURPLE) - # compiler bitwise - # obs: this is not required for emscripten 3.0.0+ - source_file = os.path.join( - source_dir, - "build", - "config", - "compiler", - "BUILD.gn", - ) - - line_content = '"-Wno-bitwise-instead-of-logical",' - line_number = f.get_file_line_number_with_content( - source_file, line_content, strip=True - ) - - if line_number: - f.prepend_to_file_line(source_file, line_number, "#") - l.bullet("Applied: compiler bitwise", l.GREEN) - else: - l.bullet("Skipped: compiler bitwise", l.PURPLE) - # copy files required l.colored("Copying required files...", l.YELLOW)