support WANT_ASAN=1 on make command line in linux.370 and macOS.370

When the address sanitizer is in use for gcc, clang, or visual studio,
(-fsanitize=address) define the NetHack preprocessor symbol USING_ADDRESS_SANITIZER.
This commit is contained in:
nhmall
2023-03-29 21:39:44 -04:00
parent cc2410e349
commit d783afbda1
4 changed files with 32 additions and 2 deletions

View File

@@ -29,6 +29,9 @@ CCFLAGS = -g
# CPLUSPLUS_NEED_DEPSUPPRESS = 1 C++ -Wno-deprecated-copy,
# -Wno-deprecated-declarations
#ifeq "$(WANT_ASAN)" "1"
NEED_ASAN=1
#endif
# If you want to override the compiler detection just carried out
# uncomment one of the following pairs. Note, however, that
@@ -60,6 +63,10 @@ CFLAGS+=-Wmissing-prototypes
CFLAGS+=-Wold-style-definition
CFLAGS+=-Wstrict-prototypes
#ifeq "$(NEED_ASAN)" "1"
CFLAGS+=-fsanitize=address
#endif
#detection of clang vs gcc
CCISCLANG := $(shell echo `$(CC) --version` | grep clang)
ifeq "$(CCISCLANG)" ""