From 2ac5a8dd2ef0e67b3fed9ad6acb162b3c2023919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 15 Jul 2021 17:11:15 +0200 Subject: [PATCH] SCons: Add method to detect Emscripten and use it for warnings config Emscripten is LLVM-based so we want to follow the same logic. But we can't just put it as a match in `methods.using_clang()` as that would mess with the compiler version detection logic used to restrict old GCC and Clang releases. (cherry picked from commit 34421683eb4075402b045f930bbe69f472d1746b) (cherry picked from commit e7f7d5f3308e322c9a1dff2a51efc26b1b734533) --- SConstruct | 2 +- methods.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 3b94b5acf2..8053eba57b 100644 --- a/SConstruct +++ b/SConstruct @@ -428,7 +428,7 @@ if selected_platform in platform_list: common_warnings += ["-Wno-misleading-indentation"] if version[0] >= 7: common_warnings += ["-Wshadow-local"] - elif methods.using_clang(env): + elif methods.using_clang(env) or methods.using_emcc(env): # We often implement `operator<` for structs of pointers as a requirement # for putting them in `Set` or `Map`. We don't mind about unreliable ordering. common_warnings += ["-Wno-ordered-compare-function-pointers"] diff --git a/methods.py b/methods.py index ba0a0cd7bc..3872da2488 100644 --- a/methods.py +++ b/methods.py @@ -842,6 +842,10 @@ def using_clang(env): return "clang" in os.path.basename(env["CC"]) +def using_emcc(env): + return "emcc" in os.path.basename(env["CC"]) + + def show_progress(env): import sys from SCons.Script import Progress, Command, AlwaysBuild