Skip to content

Commit

Permalink
Attempt to fix merge artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Soroosh129 committed Feb 26, 2022
1 parent 901eea7 commit 76dec70
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion org.lflang/src/org/lflang/generator/c/CGenerator.xtend
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class CGenerator extends GeneratorBase {
}

/**
* Set C-specific default target properties if needed.
* Set C-specific default target configurations if needed.
*/
def setCSpecificDefaults(LFGeneratorContext context) {
if (!targetConfig.useCmake && targetConfig.compiler.isNullOrEmpty) {
Expand All @@ -350,6 +350,17 @@ class CGenerator extends GeneratorBase {
targetConfig.compilerFlags.addAll("-O2") // "-Wall -Wconversion"
}
}
if (isFederated) {
// Add compile definitions for federated execution
targetConfig.compileDefinitions.put("FEDERATED", "");
if (targetConfig.coordination === CoordinationType.CENTRALIZED) {
// The coordination is centralized.
targetConfig.compileDefinitions.put("FEDERATED_CENTRALIZED", "");
} else if (targetConfig.coordination === CoordinationType.DECENTRALIZED) {
// The coordination is decentralized
targetConfig.compileDefinitions.put("FEDERATED_DECENTRALIZED", "");
}
}
}

/**
Expand Down

0 comments on commit 76dec70

Please sign in to comment.