You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/target-declaration.mdx
+22-67
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,14 @@ A target specification may have optional parameters, the names and values of whi
28
28
-[**build-type**](#build-type): One of Debug (the default), Release, RelWithDebInfo and MinSizeRel.
29
29
-[**cargo-dependencies**](#cargo-dependencies): (Rust only) list of dependencies to include in the generated Cargo.toml file.
30
30
-[**cargo-features**](#cargo-features): (Rust only) List of string names of features to include.
31
-
-[**cmake**](#cmake): Whether to use cmake for building.
32
31
-[**cmake-include**](#cmake): List of paths to cmake files to guide compilation.
33
32
-[**compiler**](#compiler): A string giving the name of the target language compiler to use.
33
+
-[**compiler-flags**](#compiler-flags): An arrays of strings giving options to be passed to the target compiler.
34
34
-[**docker**](#docker): A boolean to generate a Dockerfile.
35
35
-[**external-runtime-path**](#external-runtime-path): Specify a pre-compiled external runtime library located to link to instead of the default.
36
36
-[**export-dependency-graph**](#export-dependency-graph): To export the reaction dependency graph as a dot graph (for debugging).
37
37
-[**fast**](#fast): A boolean specifying to execute as fast as possible without waiting for physical time to match logical time.
38
38
-[**files**](#files): An array of paths to files or directories to be copied to the directory that contains the generated sources.
39
-
-[**flags**](#flags): An arrays of strings giving options to be passed to the target compiler.
40
39
-[**logging**](#logging): An indicator of how much information to print when executing the program.
41
40
-[**no-compile**](#no-compile): If true, then do not invoke a target language compiler. Just generate code.
42
41
-[**no-runtime-validation**](#no-runtime-validation): If true, disable runtime validation.
@@ -57,13 +56,12 @@ c={
57
56
auth: <true or false>
58
57
build: <string>,
59
58
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
60
-
cmake: <true or false>,
61
59
cmake-include: <string or list of strings>,
62
60
compiler: <string>,
61
+
compiler-flags: <string or list of strings>,
63
62
docker: <true or false>,
64
63
fast: <true or false>,
65
64
files: <string or list of strings>,
66
-
flags: <string or list of strings>,
67
65
logging: <error, warning, info, log, debug>,
68
66
no-compile: <true or false>,
69
67
protobufs: <string or list of strings>,
@@ -76,6 +74,7 @@ cpp={
76
74
`target Cpp {
77
75
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
78
76
cmake-include: <string or list of strings>,
77
+
compiler: <string>,
79
78
external-runtime-path: <string>,
80
79
export-dependency-graph <true or false>,
81
80
fast: <true or false>,
@@ -276,35 +275,6 @@ This is a list of features of the generated crate. Supported are:
276
275
</ShowIf>
277
276
</ShowIfs>
278
277
279
-
## cmake
280
-
281
-
<ShowIfs>
282
-
<ShowIfpyrsts>
283
-
This target does not support the `cmake` target option.
284
-
</ShowIf>
285
-
<ShowIfcpp>
286
-
The C++ target does not support the `cmake` target option because it always uses `cmake`.
287
-
</ShowIf>
288
-
<ShowIfc>
289
-
```lf-c
290
-
target C {
291
-
cmake: <true or false>
292
-
};
293
-
```
294
-
295
-
This will enable or disable the CMake-based build system (the default is `true`). Enabling the CMake build system will result in a `CMakeLists.txt` being generated in the `src-gen` directory. This `CMakeLists.txt` is then used when `cmake` is invoked by the LF runtime (either the `lfc` or the IDE). Alternatively, the generated program can be built manually. To do so, in the `src-gen/ProgramName` directory, run:
296
-
297
-
```sh
298
-
mkdir build &&cd build
299
-
cmake ../
300
-
make
301
-
```
302
-
303
-
If `cmake` is disabled, `gcc` is directly invoked after code generation by default. In this case, additional target properties, such as [compiler](#compiler) and [flags](#flags) can be used to gain finer control over the compilation process.
304
-
</ShowIf>
305
-
</ShowIfs>
306
-
307
-
308
278
<ShowOnlyccpp>
309
279
310
280
## cmake-include
@@ -361,25 +331,33 @@ See [`AsyncCallback.lf`](https://github.com/lf-lang/lingua-franca/blob/master/te
361
331
<ShowIftspyrs>
362
332
This target does not support the `compiler` target option.
363
333
</ShowIf>
334
+
<ShowIfccpp>
335
+
This parameter is a string giving the name of the compiler to use. Normally
336
+
CMake selects the best compiler for your system, but you can use this parameter
337
+
to point to your preferred compiler. Possible values are, for instance, `gcc`,
338
+
`g++`, `clang`, or `clang++`.
339
+
</ShowIf>
340
+
</ShowIfs>
341
+
342
+
## compiler-flags
343
+
344
+
<ShowIfs>
345
+
<ShowIfcpppytsrs>
346
+
This target does not support the `compiler-flags` parameter.
347
+
</ShowIf>
364
348
<ShowIfc>
365
-
This parameter is a string giving the name of the C compiler to use.
366
-
It is used only when [cmake](#cmake) is set to `false`. For example:
349
+
This parameter is a list of strings giving additional arguments to pass to the target language compiler. For example:
The `compiler` option here specifies to use `cc` rather than `gcc`.
376
-
</ShowIf>
377
-
<ShowIfcpp>
378
-
This parameter is a string giving the name of the C++ compiler to use. Normally
379
-
CMake selects the best compiler for your system, but you can use this parameter
380
-
to point it to your preferred C++ compiler.
381
-
</ShowIf>
357
+
The `compiler-flags` option specifies to include debug information in the compiled code (`-g`); a directory to search for include files (`-I/usr/local/include`); a directory to search for library files (`-L/usr/local/lib`); a library to link with (`-lpaho-mqtt3c`, which will link with file `libpaho-mqtt3c.so`).
382
358
359
+
**Note**: Using the `compiler-flags` parameter is strongly discouraged, although supported. Flags are compiler-specific, and thus interfere with CMake's ability to find the most suitable compiler for each platform. In a similar fashion, we recommend against the use of the `compiler` standard parameter for the same reason. A better solution is to provide a `cmake-include` file.
360
+
</ShowIf>
383
361
</ShowIfs>
384
362
385
363
## docker
@@ -494,29 +472,6 @@ Moreover, the `files` target specification works in conjunction with the `import
494
472
</ShowIf>
495
473
</ShowIfs>
496
474
497
-
## flags
498
-
499
-
<ShowIfs>
500
-
<ShowIfcpppytsrs>
501
-
This target does not support the `flags` parameter.
502
-
</ShowIf>
503
-
<ShowIfc>
504
-
This parameter is a list of strings giving additional arguments to pass to the target language compiler.
505
-
It is used only when [cmake](#cmake) is set to `false`. For example:
The `flags` option specifies to include debug information in the compiled code (`-g`); a directory to search for include files (`-I/usr/local/include`); a directory to search for library files (`-L/usr/local/lib`); a library to link with (`-lpaho-mqtt3c`, which will link with file `libpaho-mqtt3c.so`).
515
-
516
-
**Note**: Using the `flags` standard parameter when `cmake` is enabled is strongly discouraged, although supported. Flags are compiler-specific, and thus interfere with CMake's ability to find the most suitable compiler for each platform. In a similar fashion, we recommend against the use of the `compiler` standard parameter for the same reason. A better solution is to provide a `cmake-include` file, as described next.
Copy file name to clipboardExpand all lines: versioned_docs/version-0.6.0/reference/target-declaration.mdx
+22-67
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,14 @@ A target specification may have optional parameters, the names and values of whi
28
28
-[**build-type**](#build-type): One of Debug (the default), Release, RelWithDebInfo and MinSizeRel.
29
29
-[**cargo-dependencies**](#cargo-dependencies): (Rust only) list of dependencies to include in the generated Cargo.toml file.
30
30
-[**cargo-features**](#cargo-features): (Rust only) List of string names of features to include.
31
-
-[**cmake**](#cmake): Whether to use cmake for building.
32
31
-[**cmake-include**](#cmake): List of paths to cmake files to guide compilation.
33
32
-[**compiler**](#compiler): A string giving the name of the target language compiler to use.
33
+
-[**compiler-flags**](#compiler-flags): An arrays of strings giving options to be passed to the target compiler.
34
34
-[**docker**](#docker): A boolean to generate a Dockerfile.
35
35
-[**external-runtime-path**](#external-runtime-path): Specify a pre-compiled external runtime library located to link to instead of the default.
36
36
-[**export-dependency-graph**](#export-dependency-graph): To export the reaction dependency graph as a dot graph (for debugging).
37
37
-[**fast**](#fast): A boolean specifying to execute as fast as possible without waiting for physical time to match logical time.
38
38
-[**files**](#files): An array of paths to files or directories to be copied to the directory that contains the generated sources.
39
-
-[**flags**](#flags): An arrays of strings giving options to be passed to the target compiler.
40
39
-[**logging**](#logging): An indicator of how much information to print when executing the program.
41
40
-[**no-compile**](#no-compile): If true, then do not invoke a target language compiler. Just generate code.
42
41
-[**no-runtime-validation**](#no-runtime-validation): If true, disable runtime validation.
@@ -57,13 +56,12 @@ c={
57
56
auth: <true or false>
58
57
build: <string>,
59
58
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
60
-
cmake: <true or false>,
61
59
cmake-include: <string or list of strings>,
62
60
compiler: <string>,
61
+
compiler-flags: <string or list of strings>,
63
62
docker: <true or false>,
64
63
fast: <true or false>,
65
64
files: <string or list of strings>,
66
-
flags: <string or list of strings>,
67
65
logging: <error, warning, info, log, debug>,
68
66
no-compile: <true or false>,
69
67
protobufs: <string or list of strings>,
@@ -76,6 +74,7 @@ cpp={
76
74
`target Cpp {
77
75
build-type: <Debug, Release, RelWithDebInfo, or MinSizeRel>,
78
76
cmake-include: <string or list of strings>,
77
+
compiler: <string>,
79
78
external-runtime-path: <string>,
80
79
export-dependency-graph <true or false>,
81
80
fast: <true or false>,
@@ -276,35 +275,6 @@ This is a list of features of the generated crate. Supported are:
276
275
</ShowIf>
277
276
</ShowIfs>
278
277
279
-
## cmake
280
-
281
-
<ShowIfs>
282
-
<ShowIfpyrsts>
283
-
This target does not support the `cmake` target option.
284
-
</ShowIf>
285
-
<ShowIfcpp>
286
-
The C++ target does not support the `cmake` target option because it always uses `cmake`.
287
-
</ShowIf>
288
-
<ShowIfc>
289
-
```lf-c
290
-
target C {
291
-
cmake: <true or false>
292
-
};
293
-
```
294
-
295
-
This will enable or disable the CMake-based build system (the default is `true`). Enabling the CMake build system will result in a `CMakeLists.txt` being generated in the `src-gen` directory. This `CMakeLists.txt` is then used when `cmake` is invoked by the LF runtime (either the `lfc` or the IDE). Alternatively, the generated program can be built manually. To do so, in the `src-gen/ProgramName` directory, run:
296
-
297
-
```sh
298
-
mkdir build &&cd build
299
-
cmake ../
300
-
make
301
-
```
302
-
303
-
If `cmake` is disabled, `gcc` is directly invoked after code generation by default. In this case, additional target properties, such as [compiler](#compiler) and [flags](#flags) can be used to gain finer control over the compilation process.
304
-
</ShowIf>
305
-
</ShowIfs>
306
-
307
-
308
278
<ShowOnlyccpp>
309
279
310
280
## cmake-include
@@ -361,25 +331,33 @@ See [`AsyncCallback.lf`](https://github.com/lf-lang/lingua-franca/blob/master/te
361
331
<ShowIftspyrs>
362
332
This target does not support the `compiler` target option.
363
333
</ShowIf>
334
+
<ShowIfccpp>
335
+
This parameter is a string giving the name of the compiler to use. Normally
336
+
CMake selects the best compiler for your system, but you can use this parameter
337
+
to point to your preferred compiler. Possible values are, for instance, `gcc`,
338
+
`g++`, `clang`, or `clang++`.
339
+
</ShowIf>
340
+
</ShowIfs>
341
+
342
+
## compiler-flags
343
+
344
+
<ShowIfs>
345
+
<ShowIfcpppytsrs>
346
+
This target does not support the `compiler-flags` parameter.
347
+
</ShowIf>
364
348
<ShowIfc>
365
-
This parameter is a string giving the name of the C compiler to use.
366
-
It is used only when [cmake](#cmake) is set to `false`. For example:
349
+
This parameter is a list of strings giving additional arguments to pass to the target language compiler. For example:
The `compiler` option here specifies to use `cc` rather than `gcc`.
376
-
</ShowIf>
377
-
<ShowIfcpp>
378
-
This parameter is a string giving the name of the C++ compiler to use. Normally
379
-
CMake selects the best compiler for your system, but you can use this parameter
380
-
to point it to your preferred C++ compiler.
381
-
</ShowIf>
357
+
The `compiler-flags` option specifies to include debug information in the compiled code (`-g`); a directory to search for include files (`-I/usr/local/include`); a directory to search for library files (`-L/usr/local/lib`); a library to link with (`-lpaho-mqtt3c`, which will link with file `libpaho-mqtt3c.so`).
382
358
359
+
**Note**: Using the `compiler-flags` parameter is strongly discouraged, although supported. Flags are compiler-specific, and thus interfere with CMake's ability to find the most suitable compiler for each platform. In a similar fashion, we recommend against the use of the `compiler` standard parameter for the same reason. A better solution is to provide a `cmake-include` file.
360
+
</ShowIf>
383
361
</ShowIfs>
384
362
385
363
## docker
@@ -498,29 +476,6 @@ Moreover, the `files` target specification works in conjunction with the `import
498
476
</ShowIf>
499
477
</ShowIfs>
500
478
501
-
## flags
502
-
503
-
<ShowIfs>
504
-
<ShowIf cpp py ts rs>
505
-
This target does not support the `flags` parameter.
506
-
</ShowIf>
507
-
<ShowIf c>
508
-
This parameter is a list of strings giving additional arguments to pass to the target language compiler.
509
-
It is used only when [cmake](#cmake) is set to `false`. For example:
The `flags` option specifies to include debug information in the compiled code (`-g`); a directory to search for include files (`-I/usr/local/include`); a directory to search for library files (`-L/usr/local/lib`); a library to link with (`-lpaho-mqtt3c`, which will link with file `libpaho-mqtt3c.so`).
519
-
520
-
**Note**: Using the `flags` standard parameter when `cmake` is enabled is strongly discouraged, although supported. Flags are compiler-specific, and thus interfere with CMake's ability to find the most suitable compiler for each platform. In a similar fashion, we recommend against the use of the `compiler` standard parameter for the same reason. A better solution is to provide a `cmake-include` file, as described next.
0 commit comments