Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2021
Merged

Fix clang/sanitizer for windows #883

merged 2 commits into from
Aug 16, 2021

Conversation

byrnHDF
Copy link
Contributor

@byrnHDF byrnHDF commented Aug 6, 2021

windows clang name is clang-cl and windows flags do not use a dash.

@byrnHDF byrnHDF self-assigned this Aug 6, 2021
@@ -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)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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/

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@lrknox lrknox merged commit 6968906 into HDFGroup:develop Aug 16, 2021
lrknox pushed a commit that referenced this pull request Aug 17, 2021
lrknox pushed a commit that referenced this pull request Aug 17, 2021
@byrnHDF byrnHDF deleted the develop-clang branch September 7, 2021 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants