Update test/CMakeLists.txt
This commit is contained in:
@@ -3,13 +3,21 @@ find_package(cmocka REQUIRED)
|
||||
add_executable(test_arena test_arena.c)
|
||||
|
||||
target_link_libraries(test_arena
|
||||
arena_lib
|
||||
arena
|
||||
cmocka::cmocka
|
||||
)
|
||||
|
||||
enable_sanitizers(test_arena)
|
||||
|
||||
target_compile_options(test_arena PRIVATE -fsanitize=address -fno-omit-frame-pointer)
|
||||
target_link_options(test_arena PRIVATE -fsanitize=address)
|
||||
# Sanitizers (solo si están activados y el compilador lo soporta)
|
||||
if(ARENA_ENABLE_SANITIZERS)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
||||
target_compile_options(test_arena PRIVATE
|
||||
-fsanitize=address
|
||||
-fno-omit-frame-pointer
|
||||
)
|
||||
target_link_options(test_arena PRIVATE
|
||||
-fsanitize=address
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_test(NAME arena_tests COMMAND test_arena)
|
||||
|
||||
Reference in New Issue
Block a user