diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-23 14:49:11 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-23 15:21:26 +0200 |
commit | 26e9145c26e6a6c2794300a4a7cf5b19e8b6be37 (patch) | |
tree | b5f98590d90e8545b102f67de3e2f61f1fcd6404 /SConstruct | |
parent | 56e847ef653ce2b818b9f2095452b6c0c0c44d54 (diff) |
SCons: Cleanup `DEBUG`, `_DEBUG` and `NDEBUG` defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
outside thirdparty code, which we usually don't intend to debug, so it
seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
and `release_debug` targets. This used to be set for `release` for all
platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
code, which was only implemented for Unix anyway, should have been
`DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
target as we don't want OIDN and Embree asserting all over the place.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct index 200e8e5984..b64e0bddd8 100644 --- a/SConstruct +++ b/SConstruct @@ -386,6 +386,9 @@ if env_base["target"] == "debug": # DEV_ENABLED enables *engine developer* code which should only be compiled for those # working on the engine itself. env_base.Append(CPPDEFINES=["DEV_ENABLED"]) +else: + # Disable assert() for production targets (only used in thirdparty code). + env_base.Append(CPPDEFINES=["NDEBUG"]) # SCons speed optimization controlled by the `fast_unsafe` option, which provide # more than 10 s speed up for incremental rebuilds. @@ -669,7 +672,6 @@ if selected_platform in platform_list: print(" Use `tools=no target=release` to build a release export template.") Exit(255) suffix += ".opt" - env.Append(CPPDEFINES=["NDEBUG"]) elif env["target"] == "release_debug": if env["tools"]: suffix += ".opt.tools" |