Skip to content

target=template_debug isn't really a debugging template #1997

@Kripton2005

Description

@Kripton2005

Godot version

4.6.2.stable.official.71f334935

godot-cpp version

Most recent (I think it's irrelevant)

System information

Pop!_OS 24.04, Intel i7-13700H (also irrelevant)

Issue description

Hello! This isn't a bug per-se, but I was mislead that target=template_debug meant that it was a debugging template, using -O0 and other debugging flags, not

-fPIC -Wwrite-strings -m64 -march=x86-64 -fvisibility=hidden -O2

I get why these should be the default, because no one wants their compiled programs to run slow by default, but please rename it to template_default and make a separate template_debug.

For context, I had a UB in my code, and it stemmed from a gcc optimization from -O1 onwards. Thinking that by default I was compiling with -O0, this baffled me for a bit.

Thank you very much!

Steps to reproduce

In godot-cpp/tools/godotcpp.py you have

    env.debug_features = env["target"] in ["editor", "template_debug"]

    if env.dev_build:
        opt_level = "none"
    elif env.debug_features:
        opt_level = "speed_trace"

And

        elif env["optimize"] == "speed_trace":
            env.Append(CCFLAGS=["-O2"])

Minimal reproduction project

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions