set(CLR_SANITIZE_CXX_OPTIONS "")
set(CLR_SANITIZE_LINK_OPTIONS "")
+ if(DEFINED ENV{TIZEN_ASAN_ENVIRONMENT})
+ if (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_AMD64)
+ message(STATUS "TIZEN_ASAN_ENVIRONMENT is enabled.")
+ # add definitions to enable ASan support for only external libraries (supported only Tizen)
+ add_definitions(-DTIZEN_ASAN_ENVIRONMENT -DHAS_ADDRESS_SANITIZER)
+ set(TIZEN_ASAN_ENVIRONMENT 1)
+ else()
+ message(STATUS "TIZEN_ASAN_ENVIRONMENT cannot be enabled. Current arch is not supported.")
+ endif()
+ endif()
+
# set the CLANG sanitizer flags for debug build
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
# obtain settings from running enablesanitizers.sh
export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`
/usr/bin/gcc-unforce-options
export LD_LIBRARY_PATH=`pwd`/libicu-57.1
-export CPPFLAGS+=" -DHAS_ADDRESS_SANITIZER "
+
+# enable ASan support for only external libs
+export TIZEN_ASAN_ENVIRONMENT=1
}
BASE_FLAGS=" --target=%{_host} "