Skip to content

Commit

Permalink
remove the compiler-flags target property
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnrd committed Mar 6, 2024
1 parent ce73769 commit f11b9de
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.lflang.target.property.ClockSyncOptionsProperty.ClockSyncOptions;
import org.lflang.target.property.CmakeIncludeProperty;
import org.lflang.target.property.CompileDefinitionsProperty;
import org.lflang.target.property.CompilerFlagsProperty;
import org.lflang.target.property.CoordinationOptionsProperty;
import org.lflang.target.property.CoordinationProperty;
import org.lflang.target.property.type.ClockSyncModeType.ClockSyncMode;
Expand Down Expand Up @@ -247,8 +246,6 @@ public static void initializeClockSynchronization(
messageReporter
.nowhere()
.info("Will collect clock sync statistics for federate " + federate.id);
// Add libm to the compiler flags
CompilerFlagsProperty.INSTANCE.update(federate.targetConfig, List.of("-lm"));
}
messageReporter
.nowhere()
Expand Down
14 changes: 0 additions & 14 deletions core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.lflang.target.property.BuildTypeProperty;
import org.lflang.target.property.CmakeIncludeProperty;
import org.lflang.target.property.CompileDefinitionsProperty;
import org.lflang.target.property.CompilerFlagsProperty;
import org.lflang.target.property.CompilerProperty;
import org.lflang.target.property.PlatformProperty;
import org.lflang.target.property.ProtobufsProperty;
Expand Down Expand Up @@ -399,19 +398,6 @@ CodeBuilder generateCMakeCode(
cMakeCode.newLine();
}

// Set the compiler flags
// We can detect a few common libraries and use the proper target_link_libraries to find them
for (String compilerFlag : targetConfig.get(CompilerFlagsProperty.INSTANCE)) {
messageReporter
.nowhere()
.warning(
"Using the flags target property with cmake is dangerous.\n"
+ " Use cmake-include instead.");
cMakeCode.pr("add_compile_options( " + compilerFlag + " )");
cMakeCode.pr("add_link_options( " + compilerFlag + ")");
}
cMakeCode.newLine();

// Add the install option
cMakeCode.pr(installCode);
cMakeCode.newLine();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
import org.lflang.lf.Reaction;
import org.lflang.lf.Reactor;
import org.lflang.target.Target;
import org.lflang.target.property.CompilerFlagsProperty;
import org.lflang.target.property.CompilerProperty;
import org.lflang.target.property.ProtobufsProperty;
import org.lflang.util.FileUtil;
import org.lflang.util.LFCommand;
Expand Down Expand Up @@ -110,9 +108,6 @@ public PythonGenerator(LFGeneratorContext context) {
private PythonGenerator(
LFGeneratorContext context, PythonTypes types, CCmakeGenerator cmakeGenerator) {
super(context, false, types, cmakeGenerator, new PythonDelayBodyGenerator(types));
// Add the C target properties because they are used in the C code generator.
CompilerProperty.INSTANCE.override(this.targetConfig, "gcc"); // FIXME: why?
this.targetConfig.reset(CompilerFlagsProperty.INSTANCE);
this.types = types;
}

Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/org/lflang/target/Target.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.lflang.target.property.ClockSyncOptionsProperty;
import org.lflang.target.property.CmakeIncludeProperty;
import org.lflang.target.property.CompileDefinitionsProperty;
import org.lflang.target.property.CompilerFlagsProperty;
import org.lflang.target.property.CompilerProperty;
import org.lflang.target.property.CoordinationOptionsProperty;
import org.lflang.target.property.CoordinationProperty;
Expand Down Expand Up @@ -593,7 +592,6 @@ public void initialize(TargetConfig config) {
ClockSyncOptionsProperty.INSTANCE,
CmakeIncludeProperty.INSTANCE,
CompileDefinitionsProperty.INSTANCE,
CompilerFlagsProperty.INSTANCE,
CompilerProperty.INSTANCE,
CoordinationOptionsProperty.INSTANCE,
CoordinationProperty.INSTANCE,
Expand Down Expand Up @@ -645,9 +643,6 @@ public void initialize(TargetConfig config) {
BuildTypeProperty.INSTANCE,
CargoDependenciesProperty.INSTANCE,
CargoFeaturesProperty.INSTANCE,
CmakeIncludeProperty.INSTANCE,
CompileDefinitionsProperty.INSTANCE,
CompilerFlagsProperty.INSTANCE,
ExportDependencyGraphProperty.INSTANCE,
ExternalRuntimePathProperty.INSTANCE,
RustIncludeProperty.INSTANCE,
Expand Down

This file was deleted.

0 comments on commit f11b9de

Please sign in to comment.