File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,25 @@ if (UMPIRE_ENABLE_SYCL)
6464 endif ()
6565endif ()
6666
67+ # BLT HIP executables may link CXX-built gtest archives, so ASAN needs to be a link flag too.
68+ if (UMPIRE_ENABLE_ASAN)
69+ separate_arguments (_umpire_cxx_flags NATIVE_COMMAND "${CMAKE_CXX_FLAGS } " )
70+ foreach (_umpire_cxx_flag IN LISTS _umpire_cxx_flags)
71+ if (_umpire_cxx_flag MATCHES "^-fsanitize=.*address" )
72+ foreach (_umpire_linker_flags_var IN ITEMS
73+ CMAKE_EXE_LINKER_FLAGS
74+ CMAKE_SHARED_LINKER_FLAGS
75+ CMAKE_MODULE_LINKER_FLAGS)
76+ string (FIND " ${${_umpire_linker_flags_var} } " " ${_umpire_cxx_flag} " _umpire_linker_flag_pos)
77+ if (_umpire_linker_flag_pos EQUAL -1)
78+ string (APPEND ${_umpire_linker_flags_var} " ${_umpire_cxx_flag} " )
79+ set (${_umpire_linker_flags_var} "${${_umpire_linker_flags_var} }" CACHE STRING "" FORCE )
80+ endif ()
81+ endforeach ()
82+ endif ()
83+ endforeach ()
84+ endif ()
85+
6786if ("${CMAKE_CXX_COMPILER_ID } " STREQUAL "PGI" )
6887 message (STATUS "Setting CMAKE_CXX_EXTENSIONS to ON for PGI Compiler" )
6988 set ( CMAKE_CXX_EXTENSIONS ON )
You can’t perform that action at this time.
0 commit comments