-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the CMake code to run sanitizers.
- Loading branch information
Showing
5 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
if(TARGET HighFiveFlags) | ||
# Allow multiple `include(HighFiveWarnings)`, which would | ||
# attempt to redefine `HighFiveWarnings` and fail without | ||
# this check. | ||
return() | ||
endif() | ||
|
||
add_library(HighFiveFlags INTERFACE) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
if(HIGHFIVE_MAX_ERRORS) | ||
target_compile_options(HighFiveFlags | ||
INTERFACE | ||
-fmax-errors=${HIGHFIVE_MAX_ERRORS} | ||
) | ||
endif() | ||
endif() | ||
|
||
if(HIGHFIVE_GLIBCXX_ASSERTIONS) | ||
target_compile_definitions(HighFiveFlags INTERFACE -D_GLIBCXX_ASSERTIONS) | ||
endif() | ||
|
||
if(HIGHFIVE_HAS_FRIEND_DECLARATIONS) | ||
target_compile_definitions(HighFiveFlags INTERFACE -DHIGHFIVE_HAS_FRIEND_DECLARATIONS=1) | ||
endif() | ||
|
||
if(HIGHFIVE_SANITIZER) | ||
target_compile_options(HighFiveFlags INTERFACE -fsanitize=${HIGHFIVE_SANITIZER}) | ||
target_link_options(HighFiveFlags INTERFACE -fsanitize=${HIGHFIVE_SANITIZER}) | ||
endif() |
This file contains 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
This file contains 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
This file contains 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