From 08bded0cb32a9bad04ba06cbab26ffc52f7e24df Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Mon, 2 Nov 2020 06:30:51 -0500 Subject: [PATCH] kfdtest: Add sanitizer flags after C flags are set Otherwise they get overwritten Change-Id: I9042422d4515e7ac812ed34779906b0b2c44545c [ROCm/ROCR-Runtime commit: 92ad039915a807c80edc812bad007097fafaa23e] --- projects/rocr-runtime/tests/kfdtest/CMakeLists.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/rocr-runtime/tests/kfdtest/CMakeLists.txt b/projects/rocr-runtime/tests/kfdtest/CMakeLists.txt index 9b1624148e..ae96fdc0cc 100644 --- a/projects/rocr-runtime/tests/kfdtest/CMakeLists.txt +++ b/projects/rocr-runtime/tests/kfdtest/CMakeLists.txt @@ -100,13 +100,6 @@ include_directories(${SP3_DIR}) include_directories(${DRM_INCLUDE_DIRS}) -## Address Sanitize Flag -if ( ${ADDRESS_SANITIZER} ) - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" -fsanitize=address ) - set ( CMAKE_EXE_LINKER_FLAGS -fsanitize=address ) -endif () - - set (SRC_FILES gtest-1.6.0/gtest-all.cpp src/AqlQueue.cpp @@ -172,6 +165,12 @@ else () set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" ) endif () +## Address Sanitize Flag +if ( ${ADDRESS_SANITIZER} ) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" -fsanitize=address ) + set ( CMAKE_EXE_LINKER_FLAGS -fsanitize=address ) +endif () + # link_directories() has to be put before add_executable() # The modules found by pkg_check_modules() in the default pkg config # path do not need to use link_directories() here.