Skip to content

feat: add support for global zigopt setting#561

Merged
aherrmann merged 3 commits intoaherrmann:mainfrom
cerisier:settings-zigopts
Oct 28, 2025
Merged

feat: add support for global zigopt setting#561
aherrmann merged 3 commits intoaherrmann:mainfrom
cerisier:settings-zigopts

Conversation

@cerisier
Copy link
Contributor

Addition to #530

This allows to pass global arbitrary Zig compiler options to all compile actions.

One useful usage is to set -mcpu=native from a common:native config statement so that all compile actions receive the flag.

Added usual tests. WDYT ?

Addition to aherrmann#530

This allows to pass global arbitrary Zig compiler options to all
compile actions.

One useful usage is to set -mcpu=native from a common:native config
statement so that all compile actions receive the flag.
@cerisier cerisier changed the title feat: Add support for global zigopt setting feat: add support for global zigopt setting Oct 26, 2025
Copy link
Owner

@aherrmann aherrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Yes, that could be quite useful.

I think the docs should carry the same warning as the zigopts attribute on the other Zig rules. They should also make clear that this does not override the zigopts attribute, but add to it.

One useful usage is to set -mcpu=native from a common:native config statement so that all compile actions receive the flag.

I think that specific case would probably be better served with a cpu attribute on the zig_target_toolchain rule. The -mcpu flag (and related flags) are really a platform concern.

Copy link
Owner

@aherrmann aherrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@aherrmann aherrmann merged commit 41c4a75 into aherrmann:main Oct 28, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants