Build(presets): Adding CMake presets for compilation with ASan/MSan#398
Merged
riebl merged 3 commits intoriebl:masterfrom Feb 20, 2026
Merged
Build(presets): Adding CMake presets for compilation with ASan/MSan#398riebl merged 3 commits intoriebl:masterfrom
riebl merged 3 commits intoriebl:masterfrom
Conversation
AshFungor
reviewed
Feb 13, 2026
riebl
approved these changes
Feb 18, 2026
Owner
riebl
left a comment
There was a problem hiding this comment.
Looks good, you just need to correct the formatting of the JSON file to make clang-format happy. Then we are ready to merge.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am adding two presets for Debug builds along with AddressSanitizer/MemorySanitizer.
Commands for building:
or
To work with ASan, you need to run executable with LD_PRELOAD=path/to/libasan
The path to the libasan dynamic library can be found using
It is possible to build with a dynamic library connection (no need to mess with LD_PRELOAD), but in this case, performance issues may arise. This can even lead to compilation problems if flags for static linking are used.
Building MSan ‘out of the box’ is only possible when using certain compilers, such as Clang. Unfortunately, GCC does not have this functionality by default.
When building a project with MSan, it is recommended to specify the compiler
Also i included
--presetflag to tools/build.py which use correspond presets from CMakePresets.json or CMakeUserPresets.jsonresolves #393