mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-12-26 11:17:44 +01:00
[cmake]: Add option for Address Sanitizer check
Change-Id: I91cf9111000d2e077dafd9871b965e864863e0bf Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
parent
c56c01494d
commit
0abeafe872
5 changed files with 16 additions and 4 deletions
|
|
@ -172,6 +172,13 @@ if(GCC)
|
|||
# for libary linking
|
||||
set(BEGIN_WHOLE_ARCHIVE -Wl,--whole-archive)
|
||||
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
|
||||
|
||||
option(ASAN_CHECK "enable Address Sanitizer (Asan)" OFF)
|
||||
if(ASAN_CHECK)
|
||||
add_definitions(-fsanitize=address -static-libasan -g)
|
||||
set(ASAN_LIB libasan.a dl rt m)
|
||||
set(ASAN_BIN dl rt m)
|
||||
endif(ASAN_CHECK)
|
||||
endif(GCC)
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue