Skip to content

Commit b62babd

Browse files
authored
AppleClang UBSan has a different runtime name (#145)
1 parent b668787 commit b62babd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cpp/cmake/sanitizers.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ function(cpp_cc_enable_sanitizers)
113113
endforeach()
114114
string(JOIN " " compiler_flags_str ${compiler_flags})
115115
# Figure out where the runtime library lives
116-
cpp_cc_find_sanitizer_runtime(NAME ubsan_standalone OUTPUT runtime_library)
116+
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
117+
set(runtime_library_name ubsan)
118+
else()
119+
set(runtime_library_name ubsan_standalone)
120+
endif()
121+
cpp_cc_find_sanitizer_runtime(NAME ${runtime_library_name} OUTPUT runtime_library)
117122
if(EXISTS "${PROJECT_SOURCE_DIR}/.sanitizers/undefined.supp")
118123
set(ubsan_opts "suppressions=${PROJECT_SOURCE_DIR}/.sanitizers/undefined.supp:")
119124
endif()

0 commit comments

Comments
 (0)