Skip to content
Snippets Groups Projects
Commit ec46da10 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Add section on header-only mode to docs

parent c0c1aebe
1 merge request!22Remove Inline Output Mode; Automate Inlining in Composer
Pipeline #74411 passed with stages
in 1 minute and 56 seconds
This commit is part of merge request !22. Comments created here will be created in the context of that merge request.
...@@ -42,14 +42,15 @@ The file extensions of the generated files can be modified through ...@@ -42,14 +42,15 @@ The file extensions of the generated files can be modified through
{any}`cfg.extensions.header <FileExtensions.header>` {any}`cfg.extensions.header <FileExtensions.header>`
and {any}`cfg.extensions.impl <FileExtensions.impl>`; and {any}`cfg.extensions.impl <FileExtensions.impl>`;
and the output directory of the code generator can be set through {any}`cfg.output_directory <SfgConfig.output_directory>`. and the output directory of the code generator can be set through {any}`cfg.output_directory <SfgConfig.output_directory>`.
Header-only code generation can be enabled using {any}`cfg.header_only <SfgConfig.header_only>`. The [header-only mode](#header_only_mode) can be enabled using {any}`cfg.header_only <SfgConfig.header_only>`.
:::{danger} :::{danger}
When running generator scripts through [CMake](#cmake_integration), you should *never* set the file extensions When running generator scripts through [CMake](#cmake_integration), the file extensions,
and the output directory in the inline configuration. output directory, and header-only mode settings will be managed fully by the pystencils-sfg
Both are managed by the pystencils-sfg CMake module, and setting them manually inside the script will CMake module and the (optional) project configuration module.
lead to an error. They should therefore not be set in the inline configuration,
as this will likely lead to errors being raised during code generation.
::: :::
### Outer Namespace ### Outer Namespace
...@@ -89,6 +90,17 @@ with the `--help` flag: ...@@ -89,6 +90,17 @@ with the `--help` flag:
$ python kernels.py --help $ python kernels.py --help
``` ```
(header_only_mode)=
## Header-Only Mode
When the header-only output mode is enabled,
the code generator will emit only a header file and no separate implementation file.
In this case, the composer will automatically place all function, method,
and kernel definitions in the header file.
Header-only code generation can be enabled by setting the `--header-only` command-line flag
or the {any}`SfgConfig.header_only` configuration option.
(custom_cli_args)= (custom_cli_args)=
## Adding Custom Command-Line Options ## Adding Custom Command-Line Options
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment