Control use of clang format configuration
Control generation of clang-format file
Since R2021a
Description
App Configuration Pane: Code Appearance
Configuration Objects: coder.EmbeddedCodeConfig
Set this option to specify if you want to generate or use an existing
clang-format file to format the generated code. For more
information, see https://clang.llvm.org/docs/ClangFormatStyleOptions.html.
clang-format does not have native CUDA® C++ support. When generating CUDA code using GPU Coder™, setting the formatting tool to 'Clang-format' might result in build failures during code compilation.
Settings
Generate a new clang format configuration fileThis value is the default value.
Creates a
clang-formatfile for your build based on your configuration settings. Theclang-formatfile is generated in thecodegenfolder.Use existing clang format configuration fileFormats the generated code by using a
clang-formatfile of your choice. Usingclang-formatenables detailed control over the formatting of your generated code.The code generator searches for an existing
clang-formatfile in the code generation folder and then the folder tree above the code generation folder. The code generator looks for files whose name includes_clang-formator is a.clang-formatfile that it finds. If it is unable to find the required file, the code generator uses the built-in format specification.
Programmatic Use
Property: ClangFormatFile |
Values: 'Generate' |
'Existing' |
Default: 'Generate' |
Version History
Introduced in R2021a