changeset 267:2400c2fac4b1

Add Makefile option for building with ASAN.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 13 Feb 2021 12:33:46 +0200
parents c3c131a33023
children 7276fe5efff6
files Makefile.gen
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.gen	Tue Jan 14 04:29:24 2020 +0200
+++ b/Makefile.gen	Sat Feb 13 12:33:46 2021 +0200
@@ -1,8 +1,18 @@
 ###
 ### Compiler flags
 ###
-CFLAGS += -O2 -W -Wall -Wextra
-CXXFLAGS += -O2 -W -Wall -Wextra -std=c++11
+CFLAGS += -W -Wall -Wextra
+CXXFLAGS += -W -Wall -Wextra -std=c++11
+
+ifneq ($(ASAN),)
+XCFLAGS = -fsanitize=address
+LDFLAGS += -lasan
+else
+XCFLAGS = -O2
+endif
+
+CFLAGS += $(XCFLAGS)
+CXXFLAGS += $(XCFLAGS)
 
 
 ###