aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2025-03-26 15:31:37 +0300
committerWohlstand <admin@wohlnet.ru>2025-03-26 15:31:37 +0300
commit1a2f8dc08e2edc2040b821260071187409559619 (patch)
tree0d905786189289df6549a06448baf2e65c520501
parent6469fdd63256675602fd6a50961b40870e87fff5 (diff)
downloadlibADLMIDI-1a2f8dc08e2edc2040b821260071187409559619.tar.gz
libADLMIDI-1a2f8dc08e2edc2040b821260071187409559619.tar.bz2
libADLMIDI-1a2f8dc08e2edc2040b821260071187409559619.zip
CMake: Added support for Address Sanitizer
To debug possible memory damages
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ce1e91..a0212c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -236,6 +236,8 @@ if(WIN32)
option(WITH_WINMMDRV "Build a WinMM MIDI driver" OFF)
endif()
+option(ENABLE_ADDRESS_SANITIZER "Enable the Address Sanitizer GCC feature" OFF)
+
if(NOT WIN32
AND NOT VITA
AND NOT NINTENDO_3DS
@@ -417,6 +419,11 @@ function(handle_options targetLib)
target_compile_definitions(${targetLib} PRIVATE ADLMIDI_ENABLE_HQ_RESAMPLER)
target_link_libraries(${targetLib} PUBLIC ${ZITA_RESAMPLER_LIBRARY})
endif()
+
+ if(ENABLE_ADDRESS_SANITIZER)
+ target_compile_options(${targetLib} PUBLIC -fsanitize=address)
+ target_link_options(${targetLib} PUBLIC -fsanitize=address)
+ endif()
endfunction()
set(libADLMIDI_SOURCES