Skip to content

feat: support header generation (-femit-h) for Zig <=0.13.0 #447

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

Merged
merged 26 commits into from
Mar 24, 2025
Merged

Conversation

aherrmann
Copy link
Owner

Adds a generate_header attribute to the library rules. When enabled these rules will instruct Zig to emit a header and expose it in the "header" output group and the CcInfo provider.

Note, this feature was disabled as of Zig 0.14.0, see ziglang/zig#9698.

  • Start e2e test for header generation
  • Test generate_header attribute
  • Add generate_header attribute
  • Refactor output groups
  • e2e test for header output group
  • Generate header and expose in output group
  • header generation requires -lc
  • fix assert_outputs test
  • C generated header include test
  • Expose generated header in CcInfo
  • Forward zig.h together with the generated header
  • move zig.h into transitive CcInfos
  • zig_configure: forward output groups
  • Configure ReleaseSmall for header generation tests
  • mark tests as small
  • Add simple header generation test targets
  • analysis test that no header is generated by default
  • analysis test for header generation
  • fix shared library analysis test
  • Skip header generation with Zig 0.14.0
  • document the header output group and CcInfo
  • Document zig_header target
  • update generated files

@aherrmann
Copy link
Owner Author

Closes #428 and #14.

@aherrmann aherrmann enabled auto-merge March 23, 2025 16:41
@aherrmann aherrmann disabled auto-merge March 23, 2025 16:46
@aherrmann aherrmann enabled auto-merge March 23, 2025 16:52
@aherrmann aherrmann force-pushed the emit-h branch 2 times, most recently from 974291a to a14f163 Compare March 23, 2025 18:55
Header generation fails on debug builds. Tag the unconfigured targets as
manual to avoid these failures. Targets configured to a ReleaseSmall
configuration succeed.
@aherrmann aherrmann merged commit 11442ac into main Mar 24, 2025
55 checks passed
@aherrmann aherrmann deleted the emit-h branch March 24, 2025 07:58
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.

1 participant