Skip to content

Improve header paths in generated C++ code#965

Merged
bocchino merged 17 commits intomainfrom
issue-880-neighbor-path
Mar 25, 2026
Merged

Improve header paths in generated C++ code#965
bocchino merged 17 commits intomainfrom
issue-880-neighbor-path

Conversation

@bocchino
Copy link
Copy Markdown
Collaborator

@bocchino bocchino commented Mar 19, 2026

For header files tied to an FPP definition, use the location of the definition as the location of the header. Before we were using the current directory (where the analysis is run) in some cases.

  • Run check-cpp
  • Test with FppTest

Closes #880.

@bocchino bocchino requested a review from Kronos3 March 19, 2026 20:06
Copy link
Copy Markdown
Collaborator

@Kronos3 Kronos3 left a comment

Choose a reason for hiding this comment

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

Does this need to be updated as well?

val cppHeaderLines = {
val path = s.getRelativePath(s"$fileName.hpp")
val headers = List(path.toString)
Line.blank :: headers.map(CppWriter.headerLine)
}

@bocchino
Copy link
Copy Markdown
Collaborator Author

Does this need to be updated as well?

I don't see a way to update that one, because FppConstantsAc.cpp contains all constant definitions in the model; it's not tied to any one definition or location. We could add a command-line switch to provide more control over the location, but for now it seems OK to leave the current directory as the location.

@bocchino bocchino merged commit 6512e4b into main Mar 25, 2026
17 checks passed
@bocchino bocchino deleted the issue-880-neighbor-path branch March 25, 2026 22:24
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.

Replace getRelativePath with getNeighborPath in C++ code gen

2 participants