Skip to content

Commit

Permalink
Translator: Added Sanitizer option to catch leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Feb 24, 2024
1 parent 72061db commit 7163c63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ else()
endif()

option(PGE_STATIC_SDLMIXER "Prefer static assembly of SDL Mixer X and libraries" ${PGE_STATIC_SDLMIXER_PLATFORM_DEFAULT})
option(ENABLE_ADDRESS_SANITIZER "Enable the Address Sanitizer GCC feature" OFF)

if(PGE_STATIC_SDLMIXER)
set(PGE_SHARED_SDLMIXER OFF)
Expand Down
5 changes: 5 additions & 0 deletions Translator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ target_link_libraries(pge_translator
${PGE_TRANSLATOR_LINK_LIBS}
)

if(ENABLE_ADDRESS_SANITIZER)
target_compile_options(pge_translator PRIVATE -fsanitize=address)
target_link_options(pge_translator PRIVATE -fsanitize=address)
endif()

pge_set_nopie(pge_translator)

install(TARGETS ${PGE_TRANSLATOR_INSTALLS}
Expand Down

0 comments on commit 7163c63

Please sign in to comment.