mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-22 03:41:19 +00:00
Add an ASAN option to the Makefile.
ASAN includes DEBUG. ASAN can be overriden by the environment.
This commit is contained in:
parent
0cdfd8f292
commit
bf83db4d6d
1 changed files with 13 additions and 0 deletions
13
Makefile
13
Makefile
|
@ -109,6 +109,11 @@ else
|
|||
COMPILER := unknown
|
||||
endif
|
||||
|
||||
# ASAN includes DEBUG
|
||||
ifdef ASAN
|
||||
DEBUG=1
|
||||
endif
|
||||
|
||||
# ----------
|
||||
|
||||
# Base CFLAGS. These may be overridden by the environment.
|
||||
|
@ -116,6 +121,9 @@ endif
|
|||
# will likely break this crappy code.
|
||||
ifdef DEBUG
|
||||
CFLAGS ?= -O0 -g -Wall -pipe
|
||||
ifdef ASAN
|
||||
CFLAGS += -fsanitize=address
|
||||
endif
|
||||
else
|
||||
CFLAGS ?= -O2 -Wall -pipe -fomit-frame-pointer
|
||||
endif
|
||||
|
@ -266,6 +274,11 @@ else ifeq ($(YQ2_OSTYPE),Windows)
|
|||
LDFLAGS ?= -L/usr/lib
|
||||
endif
|
||||
|
||||
# Link address sanitizer if requested.
|
||||
ifdef ASAN
|
||||
LDFLAGS += -fsanitize=address
|
||||
endif
|
||||
|
||||
# Required libraries.
|
||||
ifeq ($(YQ2_OSTYPE),Linux)
|
||||
override LDFLAGS += -lm -ldl -rdynamic
|
||||
|
|
Loading…
Reference in a new issue