-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMakePresets.json including configuration for sanitizers
Only works with modern CMake versions that support the cmake presets version 3 or higher, i.e. CMake 3.21 or newer.
- Loading branch information
Showing
2 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "dev", | ||
"displayName": "dev", | ||
"description": "Preset for developers", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build-${presetName}", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug", | ||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON" | ||
} | ||
}, | ||
{ | ||
"name": "asan", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS_DEBUG": "-g -fsanitize=address,undefined", | ||
"CMAKE_C_FLAGS_DEBUG": "-g -fsanitize=address,undefined" | ||
} | ||
}, | ||
{ | ||
"name": "dev-asan", | ||
"displayName": "dev with sanitizers", | ||
"description": "Preset for developers with asan and ubsan enabled", | ||
"inherits": [ | ||
"dev", | ||
"asan" | ||
] | ||
}, | ||
{ | ||
"name": "dev-opt", | ||
"displayName": "dev with optimizations", | ||
"description": "Preset for developers with compiler optimizations enabled", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo", | ||
"CMAKE_CXX_FLAGS" : "-DQT_FORCE_ASSERTS -DQT_MESSAGELOGCONTEXT" | ||
}, | ||
"inherits": [ | ||
"dev" | ||
] | ||
}, | ||
{ | ||
"name": "dev-opt-asan", | ||
"displayName": "dev with optimizations and sanitizers", | ||
"description": "Preset for developers with compiler optimizations and sanitizers enabled", | ||
"inherits": [ | ||
"dev-opt", | ||
"asan" | ||
] | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "dev", | ||
"configurePreset": "dev" | ||
}, | ||
{ | ||
"name": "dev-asan", | ||
"configurePreset": "dev-asan" | ||
}, | ||
{ | ||
"name": "dev-opt", | ||
"configurePreset": "dev-opt" | ||
}, | ||
{ | ||
"name": "dev-opt-asan", | ||
"configurePreset": "dev-opt-asan" | ||
} | ||
] | ||
} |