Skip to content

Commit

Permalink
SCons: Use CXXFLAGS to disable exceptions, it's only for C++
Browse files Browse the repository at this point in the history
Following discussion in godotengine/godot-cpp#1216.

(cherry picked from commit 3bfcbe7)
  • Loading branch information
akien-mga authored and YuriSizov committed Oct 24, 2023
1 parent 10eafe2 commit 93becd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions modules/denoise/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93becd4

Please sign in to comment.