From 76dec70bb7c113b49d72580240fa5fcaf426fe42 Mon Sep 17 00:00:00 2001 From: Soroush Bateni Date: Fri, 25 Feb 2022 23:30:52 -0600 Subject: [PATCH] Attempt to fix merge artifact --- .../src/org/lflang/generator/c/CGenerator.xtend | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/generator/c/CGenerator.xtend b/org.lflang/src/org/lflang/generator/c/CGenerator.xtend index 52d4b1f153..3b98e18d4f 100644 --- a/org.lflang/src/org/lflang/generator/c/CGenerator.xtend +++ b/org.lflang/src/org/lflang/generator/c/CGenerator.xtend @@ -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) { @@ -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", ""); + } + } } /**