Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -O0 instead of -Og for Debug builds #54

Closed
alexrp opened this issue Jun 28, 2022 · 1 comment
Closed

Use -O0 instead of -Og for Debug builds #54

alexrp opened this issue Jun 28, 2022 · 1 comment
Labels
area: tasks Issues related to MSBuild tasks.
Milestone

Comments

@alexrp
Copy link
Member

alexrp commented Jun 28, 2022

// These exact flags are treated specially by zig cc/c++. They
// activate Debug, ReleaseFast, ReleaseSafe, and ReleaseSmall
// respectively. This in turns activates a bunch of other
// mode-specific flags that we do not have to specify here as a
// result.
builder.AppendSwitch((_configuration, _releaseMode) switch
{
(ZigConfiguration.Debug, _) => "-Og",
(ZigConfiguration.Release, ZigReleaseMode.Fast) => "-O3",
(ZigConfiguration.Release, ZigReleaseMode.Safe) => "-O2 -fsanitize=undefined",
(ZigConfiguration.Release, ZigReleaseMode.Small) => "-Oz",
_ => throw new Exception(),
});

See: ziglang/zig#11949

@alexrp alexrp added type: feature state: approved Enhancements and tasks that have been approved. area: tasks Issues related to MSBuild tasks. labels Jun 28, 2022
@alexrp alexrp added this to the v4.0 milestone Jun 28, 2022
@alexrp alexrp self-assigned this Jun 28, 2022
@alexrp
Copy link
Member Author

alexrp commented Jun 28, 2022

Also review our use of -O3 vs -O2.

@alexrp alexrp closed this as completed in 0155e6a Aug 4, 2023
@alexrp alexrp removed the state: approved Enhancements and tasks that have been approved. label Aug 4, 2023
@alexrp alexrp removed their assignment Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tasks Issues related to MSBuild tasks.
Development

No branches or pull requests

1 participant