mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-04-10 06:14:07 +08:00
feat: add AddressSanitizer
This commit is contained in:
@@ -56,6 +56,20 @@ add_executable(${PROJECT_NAME}
|
|||||||
src/tools/log.cpp
|
src/tools/log.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
message(STATUS "Building with AddressSanitizer enabled for target: ${PROJECT_NAME}")
|
||||||
|
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-fsanitize=address
|
||||||
|
-fno-omit-frame-pointer
|
||||||
|
-g
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-fsanitize=address
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIR})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIR})
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
|
|||||||
Reference in New Issue
Block a user