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

Mixed-target federations #2099

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix one more path problem
lhstrh committed Nov 10, 2023
commit 5ffafd3b8f3c932971e37263ce9cc7fb1b9d7f93
5 changes: 3 additions & 2 deletions core/src/main/java/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
@@ -2053,10 +2053,11 @@ protected String generateTopLevelPreambles(Reactor reactor) {
.collect(Collectors.toSet())
.forEach(it -> builder.pr(toText(it.getCode())));
for (String file : targetConfig.get(ProtobufsProperty.INSTANCE)) {
var dotIndex = file.lastIndexOf(".");
var fileName = Path.of(file).getFileName().toString();
var dotIndex = fileName.lastIndexOf(".");
var rootFilename = file;
if (dotIndex > 0) {
rootFilename = file.substring(0, dotIndex);
rootFilename = fileName.substring(0, dotIndex);
}
code.pr("#include " + addDoubleQuotes(rootFilename + ".pb-c.h"));
builder.pr("#include " + addDoubleQuotes(rootFilename + ".pb-c.h"));