-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cmake-init-include target property
- Loading branch information
Showing
8 changed files
with
75 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
core/src/main/java/org/lflang/target/property/CmakeInitIncludeProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.lflang.target.property; | ||
|
||
import java.util.List; | ||
|
||
import org.lflang.MessageReporter; | ||
import org.lflang.ast.ASTUtils; | ||
import org.lflang.lf.Element; | ||
|
||
/** | ||
* Directive to specify cmake initialize files to be included at the very beginning of the | ||
* generated CMakeLists.txt. Here the user can override things like the toolchain file | ||
*/ | ||
|
||
public final class CmakeInitIncludeProperty extends FileListProperty { | ||
|
||
/** Singleton target property instance. */ | ||
public static final CmakeInitIncludeProperty INSTANCE = new CmakeInitIncludeProperty(); | ||
|
||
private CmakeInitIncludeProperty() { | ||
super(); | ||
} | ||
|
||
@Override | ||
protected List<String> fromAst(Element node, MessageReporter reporter) { | ||
return ASTUtils.elementToListOfStrings(node); | ||
} | ||
|
||
@Override | ||
protected List<String> fromString(String string, MessageReporter reporter) { | ||
throw new UnsupportedOperationException("Not supported yet."); | ||
} | ||
|
||
@Override | ||
public Element toAstElement(List<String> value) { | ||
return ASTUtils.toElement(value); | ||
} | ||
|
||
@Override | ||
public String name() { | ||
return "cmake-init-include"; | ||
} | ||
|
||
@Override | ||
public boolean loadFromFederate() { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters