Allow to use compiler's sanitizer. This fixes #53.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-19 17:38:36 +02:00
parent ca51e2a5da
commit a1f1d50d25
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,9 @@ RCFLAGS = -O3 -s
# Flags to pass to the linker
LDFLAGS =
# Flags to enable sanitize checker
SFLAGS = -fsanitize=address -fsanitize=leak -fsanitize=undefined
# Destination directory
DESTDIR ?= $(realpath .)/binary
@ -123,6 +126,9 @@ debug: export CFLAGS := $(CFLAGS) $(DCFLAGS)
debug: engine sapi modules
release: export CFLAGS := $(CFLAGS) $(RCFLAGS)
release: engine sapi modules
sanitize: export CFLAGS := $(CFLAGS) $(DCFLAGS) $(SFLAGS)
sanitize: $(eval LDFLAGS := $(LDFLAGS) $(SFLAGS))
sanitize: engine sapi modules
engine: $(ENGINE_OBJS)
$(CC) -o $(BUILD_DIR)/lib$(BINARY)$(LIBSUFFIX) $(LDFLAGS) $(LIBS) -shared $(ENGINE_OBJS)