-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fix clang/sanitizer for windows #883
Conversation
@@ -83,7 +83,7 @@ if(USE_SANITIZER) | |||
elseif(MSVC) | |||
if(USE_SANITIZER MATCHES "([Aa]ddress)") | |||
message(STATUS "Building with Address sanitizer") | |||
append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) | |||
append("/fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be restricted to VS 2019 16.9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS2019 seems to be the first version to work with "${CMAKE_C_COMPILER_ID}" MATCHES "Clang". There is also a case where a LLVM compiler can be used with changes to VS paths, but it IDs as LLVM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've seen on the interwebs, /fsanitize=address
was only added in VS 2019 16.9.
https://devblogs.microsoft.com/cppblog/address-sanitizer-for-msvc-now-generally-available/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that is what we have on our test machines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added check for MSVC version.
windows clang name is clang-cl and windows flags do not use a dash.