From 93becd4d2ee8d84742ca17b7bdab28f302970bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 19 Oct 2023 16:28:07 +0200 Subject: [PATCH] SCons: Use CXXFLAGS to disable exceptions, it's only for C++ Following discussion in https://github.com/godotengine/godot-cpp/pull/1216. (cherry picked from commit 3bfcbe7946fc17d7b61a587bc3dcc8e94633e3d3) --- SConstruct | 4 ++-- modules/denoise/SCsub | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 791ff463039..2779ce00b0b 100644 --- a/SConstruct +++ b/SConstruct @@ -707,9 +707,9 @@ if selected_platform in platform_list: if env.msvc: env.Append(CPPDEFINES=[("_HAS_EXCEPTIONS", 0)]) else: - env.Append(CCFLAGS=["-fno-exceptions"]) + env.Append(CXXFLAGS=["-fno-exceptions"]) elif env.msvc: - env.Append(CCFLAGS=["/EHsc"]) + env.Append(CXXFLAGS=["/EHsc"]) # Configure compiler warnings if env.msvc: # MSVC diff --git a/modules/denoise/SCsub b/modules/denoise/SCsub index 967a511e1e0..028d2296f73 100644 --- a/modules/denoise/SCsub +++ b/modules/denoise/SCsub @@ -114,9 +114,9 @@ if env["disable_exceptions"]: # OIDN hard-requires exceptions, so we re-enable them here. if env.msvc and ("_HAS_EXCEPTIONS", 0) in env_thirdparty["CPPDEFINES"]: env_thirdparty["CPPDEFINES"].remove(("_HAS_EXCEPTIONS", 0)) - env_thirdparty.AppendUnique(CCFLAGS=["/EHsc"]) - elif not env.msvc and "-fno-exceptions" in env_thirdparty["CCFLAGS"]: - env_thirdparty["CCFLAGS"].remove("-fno-exceptions") + env_thirdparty.AppendUnique(CXXFLAGS=["/EHsc"]) + elif not env.msvc and "-fno-exceptions" in env_thirdparty["CXXFLAGS"]: + env_thirdparty["CXXFLAGS"].remove("-fno-exceptions") env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources) env.modules_sources += thirdparty_obj