-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sanitizer option to user presets #81
Comments
I am actually in the process of adding hardening flags to the presets, so I guess this is covered by that. I'll think about whether to make sanitizers the default or not. Right now, there is a separate sanitizer build config for CI that one can also use locally. |
0.35.0 added hardening flags for all platforms, however I'm not sure of the usefulness of adding a separate sanitizer user preset. Basically it comes down to the fact that Windows does not really have feature parity with Linux and Mac, but I also don't want to put too many things in the user presets. I want the user presets to be easily reproducible using the contribution documents. |
IMO, the address sanitizer on its own is already very helpful, and it is available for MSVC. |
I'd like to think that based on how
For anyone interested, adding sanitizer based on the existing {
"name": "dev",
"binaryDir": "${sourceDir}/build/dev",
"inherits": "dev-win64",
"cacheVariables": {
"CMAKE_CONFIGURATION_TYPES": "Sanitize;RelWithDebInfo;Release;Debug",
"CMAKE_CXX_FLAGS_SANITIZE": "/fsanitize=address /MDd /Zi /Od",
"CMAKE_MAP_IMPORTED_CONFIG_SANITIZE": "Sanitize;RelWithDebInfo;Release;Debug;",
"CMAKE_EXE_LINKER_FLAGS_SANITIZE": "/debug /INCREMENTAL:NO",
"CMAKE_SHARED_LINKER_FLAGS_SANITIZE": "/debug /INCREMENTAL:NO"
}
}, The For other platforms, you can likely just copy paste the CI preset and adjust for your platform. Granted, the above adds a new preset to the usual ones, because I don't want to overload the other configurations. Sanitizers can be used for for debug and release builds, so that's why I don't put this in say |
For the record, the various sanitisers are also incompatible with |
I would like to see an option to enable the address (and UB?) sanitizer(s) in
CMakeUserPresets.json
or even enable it/them by default for (at least) the unit tests. The address sanitizer is available for MSVC so this one can safetly be move as a OS agnostic option.The text was updated successfully, but these errors were encountered: