Print a notice when compiling with target=debug

Debug builds are considerably slower than release builds or even
release_debug builds. `target=debug` is still the default SCons
target option, so unsuspecting users may be compiling unoptimized
debug builds for their personal use.
This commit is contained in:
Hugo Locurcio 2020-05-23 02:12:01 +02:00
parent 0638ca0037
commit 89b5a569fb
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -551,11 +551,10 @@ if selected_platform in platform_list:
if env["target"] == "release": if env["target"] == "release":
if env["tools"]: if env["tools"]:
print("Tools can only be built with targets 'debug' and 'release_debug'.") print("Error: The editor can only be built with `target=debug` or `target=release_debug`.")
Exit(255) Exit(255)
suffix += ".opt" suffix += ".opt"
env.Append(CPPDEFINES=["NDEBUG"]) env.Append(CPPDEFINES=["NDEBUG"])
elif env["target"] == "release_debug": elif env["target"] == "release_debug":
if env["tools"]: if env["tools"]:
suffix += ".opt.tools" suffix += ".opt.tools"
@ -563,8 +562,14 @@ if selected_platform in platform_list:
suffix += ".opt.debug" suffix += ".opt.debug"
else: else:
if env["tools"]: if env["tools"]:
print(
"Note: Building a debug binary (which will run slowly). Use `target=release_debug` to build an optimized release binary."
)
suffix += ".tools" suffix += ".tools"
else: else:
print(
"Note: Building a debug binary (which will run slowly). Use `target=release` to build an optimized release binary."
)
suffix += ".debug" suffix += ".debug"
if env["arch"] != "": if env["arch"] != "":