Skip to content

Commit e896718

Browse files
committed
GPU Standalone can compile with sanitizers also without debug build
1 parent fc2133e commit e896718

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

GPU/GPUTracking/Standalone/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
5050

5151
if(GPUCA_BUILD_DEBUG)
5252
set(CMAKE_CXX_FLAGS "-O0 -ggdb")
53-
if (GPUCA_BUILD_DEBUG_SANITIZE)
54-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined -fno-sanitize=vptr") #TODO: Check why this does not work with clang
55-
endif()
5653
set(CMAKE_BUILD_TYPE DEBUG)
5754
else()
5855
set(CMAKE_CXX_FLAGS "-O3 -march=native -ggdb -minline-all-stringops -funroll-loops -fno-stack-protector")
@@ -67,6 +64,9 @@ else()
6764
set(CMAKE_BUILD_TYPE RELEASE)
6865
add_definitions(-DNDEBUG)
6966
endif()
67+
if (GPUCA_BUILD_DEBUG_SANITIZE)
68+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined -fno-sanitize=vptr") #TODO: Check why this does not work with clang
69+
endif()
7070
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error -Wall -Wextra -Wshadow -Wno-unused-function -Wno-unused-parameter -Wno-unused-local-typedefs -Wno-unknown-pragmas -Wno-write-strings")
7171
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic -Wl,--no-undefined")
7272

0 commit comments

Comments
 (0)