Skip to content

Configurations

Ramon Viladomat edited this page Nov 11, 2020 · 19 revisions

Struct Layout Options & Configurations

This is the help section to setup the Extension options.

Because each solution might need different extra parameters and different needs, the parser options with the extra parameters are stored in a file called StructLayoutSettings.json next to the solution.

The options page can be opened from:

Extensions Menu

Extensions

Bottom-left corner in the Tool Window

Extensions

The options contain the following properties:

Property Description Macros
Automatic Extraction If true, it will try to extract from the current solution the architecture, include paths, preprocessor definitions... No
Extra Preprocessor Defintions Additional preprocessor definitions on top of the auto extracted form the project configuration. Yes
Extra Include Dirs Additional include directories on top of the auto extracted form the project configuration. Yes
Extra Force Includes Additional files to force include on top of the auto extracted form the project configuration. Yes
Extra Parser Args Additional command line arguments passed in to the clang parser. Yes
Enable Warnings If true, the clang parser will output the warnings found. No

Some fields accept macros in the form $(MACRO). The valid macros will depend on the nature of the solution, check below for allowed macros.

The additional include directories, force includes and preprocessor definitions can be typed in following the same format as the Visual Studio properties (; separated). Example:

includePathA;${SolutionDir}Folder/;${ProjectDir}...

The extra arguments will be appended at the end. Example:

-std=c++17 -ftime-trace -I${SolutionDir}Folder/

Remember to use the Save button to apply your changes.

Projects

⚠️ If the project is using PCHs, due to the fact that most of the struct definitions are in header files, the precompiled headers might need to be forced included.

⚠️ Some big projects use Unity builds or similar. This might lead to ill-formed dependency trees in some files, leading to parsing errors when attempting to parse a single unit.

Visual Studio Projects

For Visual Studio Projects the Automatic Extraction extracts:

  • Active Configuration: x64 or x86
  • Active Project Properties: VC++ Directories -> Include Directories
  • Active Project Properties: VC++ Directories -> Exclude Directories
  • Active Project Properties: C/C++ -> Language -> C++ Language Standard
  • Active Project Properties: C/C++ -> General -> Additional Include Directories
  • Active Project Properties: C/C++ -> Preprocessor -> Preprocessor Definitions
  • Active Project Properties: Advanced -> Forced Include File
  • Active Project Properties: NMake -> Additional Include Directories
  • Active Project Properties: NMake -> Additional Force Includes
  • Active Project Properties: NMake -> Additional Preprocessor Definitions
  • Active File Properties: C/C++ -> General -> Additional Include Directories
  • Active File Properties: C/C++ -> Preprocessor -> Preprocessor Definitions
  • Active File Properties: Advanced -> Forced Include File

Macros available: All MSBuild macros.

Unreal Engine 4

When dealing with UE4 projects you also have the following extra macros available:

Name Description
UE4ModuleName Fetches the Name of the module that contains the Active File. This is done by moving up folders until finding a folder with a matching .Build.cs. This assumption might be wrong, please feel free to add an issue if there is a better way to detect this.

The recommended default configuration is the following:

Property Value
Automatic Extraction Yes
Extra Preprocessor Defintions UNREAL_CODE_ANALYZER
Extra Include Dirs
Extra Force Includes $(SolutionDir)Engine\Intermediate\Build\Win64\UE4Editor\Development$(UE4ModuleName)\Definitions.$(UE4ModuleName).h
Extra Parser Args
Enable Warnings

Can also be downloaded directly from here.

CMake Projects

CMake auto detection is still work in progress. Feel free to join the discussion.

Due to the fact that the project does not have an explicit VS project, the MSBuild macros can't be queried, still a small subset has been implemented:

Macros available:

Name Description
SolutionDir Opened folder path
ProjectDir Opened folder path
Clone this wiki locally