Version:

AZ Code Generator Parameters

AZ Code Generator Parameters


AZ Code Generator is in preview release and is subject to change.

For best results, pass the options for AZ Code Generator in to the Waf build system. However, you can also specify the parameters for AzCodeGenerator.exe on the command line.

Topics

Waf Parameters

Most parameters for AZ Code Generator are specified by the Waf integration. Parameters such as input, output, and include paths are automatically detected and forwarded. Other AZ Code Generator parameters control how AZ Code Generator deals with the source code input and the intermediate data that is generated.

Specify any of these in the arguments section of the az_code_gen pass in the wscript file.

Clang Compilation Parameters

The following AzCodeGenerator.exe parameters apply to Clang compilation.


ParameterDescription
-SuppressIncludeNotFoundErrorSuppresses unknown #include statements at compile time.
-OnlyRunDiagnosticsOnMainFileIgnores build warnings and errors on all except the main file specified for compilation.
-SuppressDiagnosticsIgnores build warnings and errors on all files.
-SuppressErrorsAsWarningsDowngrades any build errors to warnings. Allows Clang to succeed even if there are errors.

Intermediate Data

To include information about code outside of the input file in the intermediate JSON data, use the following option.

-inclusion-filter=<wildcard filter for files to allow>

Front End

You can choose the front end to use by specifying either the -Clang (the default) or -JSON option.

AZ Code Generator Parameter List

The following list shows all AZ Code Generator parameters.

Usage: AzCodeGenerator.exe [options]


OptionCategoryDescription
-ClangGeneralUses the Clang compiler front end.
-clang-settings-file=Code parsingThe path to the file that contains Clang configuration settings.
-codegen-script=PythonThe absolute path and file name of the code generation script to invoke.
-debugGeneralEnables debug output.
-debug-buffer-size=GeneralBuffers the last n characters of debug output until program termination. The default is 0, which specifies immediate print out.
-debug-only=GeneralEnables a specific type of debug output.
-define=Code parsingSpecifies a preprocessor definition.
-DelayedTemplateParsingAST traversalConsumes and stores template tokens for parsing at the end of the translation unit.
-EnableIncrementalProcessingAST traversalEnables incremental processing.
-force-include=Code parsingList of headers to forcibly include in Clang parsing.
-helpGeneralDisplays basic options in categorized format.
-help-hiddenGeneralDisplays all available options in categorized format.
-help-listGeneralDisplays basic options in list format.
-help-list-hiddenGeneralDisplays all available options in list format.
-include-path=Code parsingThe header includes the path.
-inclusion-filter=Code filteringSpecifies a wildcard filter so that files other than those specified by input-files are parsed by Clang into intermediate data.
-info-output-file=GeneralFile to which to append -stats output.
-input-file=Code parsing(Required) Path to input file relative to the value of input-path.
-input-path=Code parsing(Required) The absolute path to input folder. All input-file paths must be relative to this folder.
-intermediate-file=Code parsingPath to a file that stores the JSON AST from Clang parsing.
-JSONGeneralUses raw JSON input for the front end.
-noscriptsGeneralDisables the running of code generation scripts.
-OnlyRunDiagnosticsOnMainFileClang compilationRuns diagnostics (error and warning checking) only on the main file that is compiled. Ignores errors and warnings from all other files.
-output-path=Code parsing(Required) The absolute path to the output folder.
-output-redirectionOutputRedirects output and error messages from Clang and Python internal utilities. Options: =none – No output redirection. Clang and Python output to stdout and stderr. =null – Redirect Clang and Python to null, effectively suppressing output. =file – Redirect Clang and Python to disk. Use redirect-output-file to specify the path.
-output-using-jsonOutputOutputs using JSON objects instead of plain text. Use this option to ease parsing for calling applications.
-print-all-optionsGeneralPrints all option values after command line parsing.
-print-optionsGeneralPrints nondefault options after command line parsing.
-profileGeneralEnables AZ Code Generator’s internal profiler and emits timings for Clang parsing and script execution.
-python-debug-path=PythonPath to Python debug libraries and scripts for AzCodeGenerator.exe to use in debugging.
-python-home=Python(Required) The equivalent of the PYTHONHOME environment variable, which is ignored.
-python-home-debug=PythonThe equivalent of the debug Python PYTHONHOME environment variable, which is ignored.
-python-path=PythonThe path to Python libraries and scripts for AzCodeGenerator.exe.
-redirect-output-file=OutputThe file path for redirected output. Use in combination with the -output-redirection=file option. The default file name is output.log.
-resource-dir=Code parsingThe path to the resource directory for Clang.
-statsGeneralEnables statistics output from program (available with asserts). Use the -info-output-file= option to specify the output file.
-SkipFunctionBodiesAST traversalDoes not traverse function bodies.
-SuppressDiagnosticsClang compilationHides Clang compilation diagnostic information.
-SuppressErrorsAsWarningsClang compilationSuppresses compilation errors during parsing by reporting them as warnings.
-SuppressIncludeNotFoundErrorAST traversalSuppresses #include not found errors.
-track-memoryGeneralEnables -time-passes memory tracking. Performance might be slow when this option is used.
-vGeneralOutputs verbose debug information.
-versionGeneralDisplays the version of AzCodeGenerator.exe.
-view-backgroundGeneralExecutes the graph viewer in the background. This option creates a .tmp file that must be deleted manually.