project_options icon indicating copy to clipboard operation
project_options copied to clipboard

question/request: enable clang/gcc sanitizers on windows

Open FeignClaims opened this issue 1 year ago • 2 comments

My junior classmate is trying to learn C++ with my vscode tutorial that uses clang installed by msys2 on windows, but I noticed project_options won't enable sanitizers for him because,

https://github.com/aminya/project_options/blob/86e68a9267caa3fdad3e8ad16d52ac02884ca13e/src/Sanitizers.cmake#L172-L174

As a result, the cmake configuration says,

No sanitizer is supported for the current platform/compiler

I removed the above NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" and configured again, the sanitizers are enabled and work correctly.

So I'm wondering why dose project_options disable clang/gcc sanitizers on windows and I suggest maybe we should investigate the current support for sanitizers on windows. (BTW Unfortunately, I can't reach my windows computer until next year).

FeignClaims avatar Nov 01 '24 11:11 FeignClaims

These conditions were added because it didn't work on Windows back when I wrote the code. Which versions of the compilers would work? We can allow recent versions if know the range.

aminya avatar Nov 12 '24 13:11 aminya

These conditions were added because it didn't work on Windows back when I wrote the code. Which versions of the compilers would work? We can allow recent versions if know the range.

Not sure yet. I'll have to wait until next year when I can get a Windows computer to try them out specifically. The example above is clang 18.1.8 installed in the msys2 clang64 environment. That is,

$ clang --version
clang version 18.1.8
Features: windows
Platform: x86_64-w64-windows-gnu

FeignClaims avatar Nov 12 '24 14:11 FeignClaims