lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.generator.c.CCmakeGenerator Class Reference

A helper class that generates a CMakefile that can be used to compile the generated C code. More...

Classes

interface  SetUpMainTarget
 Provide a strategy for configuring the main target of the CMake build. More...

Public Member Functions

 CCmakeGenerator (FileConfig fileConfig, List< String > additionalSources)
 CCmakeGenerator (FileConfig fileConfig, List< String > additionalSources, SetUpMainTarget setUpMainTarget, String installCode)
void setCmakeGenerator (SetUpMainTarget setUpMainTarget)
 Set the code generator for the CMake main target.

Static Public Attributes

static final String MIN_CMAKE_VERSION = "3.19"

Package Functions

CodeBuilder generateCMakeCode (List< String > sources, boolean CppMode, boolean hasMain, String cMakeExtras, LFGeneratorContext context)
 Generate the contents of a CMakeLists.txt that builds the provided LF C 'sources'.

Detailed Description

A helper class that generates a CMakefile that can be used to compile the generated C code.

Adapted from

See also
org.lflang.generator.CppCmakeGenerator.kt
Author
Soroush Bateni
Peter Donovan

Constructor & Destructor Documentation

◆ CCmakeGenerator() [1/2]

org.lflang.generator.c.CCmakeGenerator.CCmakeGenerator ( FileConfig fileConfig,
List< String > additionalSources )

◆ CCmakeGenerator() [2/2]

org.lflang.generator.c.CCmakeGenerator.CCmakeGenerator ( FileConfig fileConfig,
List< String > additionalSources,
SetUpMainTarget setUpMainTarget,
String installCode )

Member Function Documentation

◆ generateCMakeCode()

CodeBuilder org.lflang.generator.c.CCmakeGenerator.generateCMakeCode ( List< String > sources,
boolean CppMode,
boolean hasMain,
String cMakeExtras,
LFGeneratorContext context )
package

Generate the contents of a CMakeLists.txt that builds the provided LF C 'sources'.

Any error will be reported in the 'errorReporter'.

Parameters
sourcesA list of .c files to build.
CppModeIndicate if the compilation should happen in C++ mode
hasMainIndicate if the .lf file has a main reactor or not. If not, a library target will be created instead of an executable.
cMakeExtrasCMake-specific code that should be appended to the CMakeLists.txt.
contextThe context of the code generator.
Returns
The content of the CMakeLists.txt.

◆ setCmakeGenerator()

void org.lflang.generator.c.CCmakeGenerator.setCmakeGenerator ( SetUpMainTarget setUpMainTarget)

Set the code generator for the CMake main target.

Parameters
setUpMainTarget

Member Data Documentation

◆ MIN_CMAKE_VERSION

final String org.lflang.generator.c.CCmakeGenerator.MIN_CMAKE_VERSION = "3.19"
static

The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java