@@ -53,7 +53,7 @@ function(tiny_engine_configure_target TARGET_NAME)
5353 endif ()
5454 endif ()
5555
56- # Add `DEBUG` macro in debug builds.
56+ # Add `DEBUG` macro in non-release builds.
5757 if (NOT IS_RELEASE_BUILD)
5858 message (STATUS "${PROJECT_NAME } : adding DEBUG macro" )
5959 target_compile_definitions (${TARGET_NAME} PUBLIC DEBUG )
@@ -72,8 +72,15 @@ function(tiny_engine_configure_target TARGET_NAME)
7272 target_include_directories (${TARGET_NAME} PUBLIC include )
7373 target_include_directories (${TARGET_NAME} PRIVATE src )
7474
75+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "v8|arm64|aarch64" )
76+ set (IS_ARM64 1)
77+ else ()
78+ set (IS_ARM64 0)
79+ endif ()
80+ message (STATUS "${TARGET_NAME} : is running ARM64: ${IS_ARM64} " )
81+
7582 # Enable ASan.
76- if (NOT IS_RELEASE_BUILD AND NOT MSVC AND NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT ENGINE_DISABLE_ASAN_IN_DEBUG)
83+ if (IS_ARM64 EQUAL 0 AND NOT IS_RELEASE_BUILD AND NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT ENGINE_DISABLE_ASAN_IN_DEBUG AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER MATCHES "clang" ) )
7784 message (STATUS "${TARGET_NAME} : Address sanitizer is enabled." )
7885 target_compile_definitions (${TARGET_NAME} PRIVATE ENGINE_ASAN_ENABLED )
7986 target_compile_options (${TARGET_NAME} PRIVATE -fno-omit-frame-pointer )
@@ -83,6 +90,12 @@ function(tiny_engine_configure_target TARGET_NAME)
8390 if (CMAKE_COMPILER_IS_GNUCC)
8491 target_compile_options (${TARGET_NAME} PRIVATE -static-libasan )
8592 endif ()
93+ else ()
94+ if (NOT IS_RELEASE_BUILD AND NOT CMAKE_SIZEOF_VOID_P EQUAL 4)
95+ message (WARNING "${TARGET_NAME} : Address sanitizer is disabled." )
96+ else ()
97+ message (STATUS "${TARGET_NAME} : Address sanitizer is disabled." )
98+ endif ()
8699 endif ()
87100
88101 # Memcheck macro.
0 commit comments