Skip to content

Commit

Permalink
open ENABLE_ADDRESSSANITIZER
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Jan 12, 2024
1 parent 91e6f2b commit 27020d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ include("${PROJECT_SOURCE_DIR}/tarscpp/cmake/ParseAsm.cmake")

add_subdirectory(tarscpp)

if(UNIX OR APPLE)
option(ENABLE_ADDRESSSANITIZER "enable AddressSanitizer" OFF)
if(ENABLE_ADDRESSSANITIZER)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -fsanitize=address -fno-omit-frame-pointer -g")
endif ()

message("ENABLE_ADDRESSSANITIZER: ${ENABLE_ADDRESSSANITIZER}")
endif()

set(major "3")
set(minor "0")
set(patch "16")

set(FRAMEWORK_VERSION ${major}.${minor}.${patch})
add_definitions(-DFRAMEWORK_VERSION="${FRAMEWORK_VERSION}")
add_definitions(-DTARS_VERSION="${TARS_VERSION}")
Expand Down

0 comments on commit 27020d8

Please sign in to comment.