瀏覽代碼

Adds flags for memory and address sanitizer

tags/v0.0.1
Henry Case 3 年之前
父節點
當前提交
a0e38afc59
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. +17
    -0
      CMakeLists.txt

+ 17
- 0
CMakeLists.txt 查看文件

@@ -115,6 +115,23 @@ if(CLANG)
-Wmissing-variable-declarations")
endif()

# Build with address sanitizer
if(ADDRSAN)
set(CLANG 1)
set(C_CXX_FLAGS "${C_CXX_FLAGS} -fsanitize=undefined,address,leak -fno-omit-frame-pointer")
set(LDFLAGS "${LDFLAGS} -fsanitize=undefined,address,leak")
endif()

# Build with memory sanitizer
if(MEMSAN)
if(ADDRSAN)
message(FATAL_ERROR "Can't use MSAN and ASAN")
endif()

set(CLANG 1)
set(C_CXX_FLAGS "${C_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
endif()

include(.cmake/common.mk)

# Control Debug/Release mode


Loading…
取消
儲存