Skip to content

Replace generated include folder with src-gen/include#2223

Open
petervdonovan wants to merge 8 commits into
masterfrom
user-facing-include-path
Open

Replace generated include folder with src-gen/include#2223
petervdonovan wants to merge 8 commits into
masterfrom
user-facing-include-path

Conversation

@petervdonovan
Copy link
Copy Markdown
Collaborator

These changes to the includes actually were not necessary in order to eliminate the generated include directory in the project root. However I changed them anyway because they were a code smell (making assumptions about the relative locations of files instead of using the include path properly).

These changes to the includes actually were not necessary in order to
eliminate the generated include directory in the project root. However I
changed them anyway because they were a code smell (making assumptions
about the relative locations of files instead of using the include path
properly).
@edwardalee edwardalee requested a review from Copilot March 1, 2026 18:07
@edwardalee edwardalee marked this pull request as ready for review March 1, 2026 18:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the need for a generated include directory outside of src-gen by placing generated/runtime headers directly under each program’s src-gen/.../include directory and updating test C sources to include headers via the include search path instead of relative ../include/... paths.

Changes:

  • Update C test helper sources to include generated/runtime headers using "Pkg/Header.h" style paths (no ../include/...).
  • Stop copying header artifacts into src-gen/include during header generation (now written/copied there directly).
  • Simplify C target include path configuration to always use <src-gen>/.../include.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/C/c/sendreceive.c Switch includes from ../include/... to include-path-based "...".
test/C/c/multiport_to_reaction_no_inlining.c Same include-path cleanup for generated header include.
test/C/c/count_hierarchy.c Same include-path cleanup for generated header include.
test/C/c/count.c Same include-path cleanup for generated header include.
test/C/c/bank_to_reaction_no_inlining.c Same include-path cleanup for generated header include.
test/C/c/bank_multiport_to_reaction_no_inlining.c Same include-path cleanup for generated header include.
core/src/main/java/org/lflang/generator/c/CGenerator.java Remove redundant copy step now that includes live under src-gen/.../include.
core/src/main/java/org/lflang/generator/c/CFileConfig.java Point includePath directly at getSrcGenPath()/include.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants