
Format: flag1=value:flag2=value2.īuildCommandArgs: Specifies native build switches passed to CMake after -build. On Linux, compile with -fno-omit-frame-pointer and compiler optimization level -Os or -Oo for best results.ĪddressSanitizerRuntimeFlags: The runtime flags passed to AddressSanitizer in the ASAN_OPTIONS environment variable. You can add any number of pre-defined or custom configurations to the file.ĪddressSanitizerEnabled: If true, compiles the program using AddressSanitizer. For more information about the pre-defined configurations, see CMake predefined configuration reference. The configurations array contains all the configurations for a CMake project. For more information, see Customize CMake build settings in Visual Studio.

You can switch between the configurations easily in the IDE to generate the various project files.

You can add or remove configurations in the IDE and then edit them directly in the JSON file or use the CMake Settings editor (Visual Studio 2019 and later). The values can be overridden in the CMakeLists.txt files. CMake uses the command-line arguments to regenerate the root CMakeCache.txt file and other project files for the project. Each configuration specifies an environment, which encapsulates information about the compiler toolset, for example MSVC, GCC, or Clang.

A configuration specifies properties that apply to a specific platform and build-type, for example, x86-Debug or Linux-Release. The CMakeSettings.json file contains information that Visual Studio uses for IntelliSense and to construct the command-line arguments that it passes to CMake for a specified configuration and compiler environment.
