From e7c50f60191fa71fd8bb8a17da27082a6620480f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sat, 4 May 2013 09:48:04 +0000 Subject: [PATCH] added makefile define SANITIZE to specify the sanitizer to use (supported by latest GCC and clang versions) / added additional library necessary to link with clang on linux (nw) --- makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/makefile b/makefile index 4fe689a3d84..041a7df3cf3 100644 --- a/makefile +++ b/makefile @@ -247,6 +247,9 @@ BUILD_MIDILIB = 1 # uncomment next line to generate verbose build information # VERBOSE = 1 +# specify the sanitizer to use or leave empty to use none +# SANITIZE = + # specify optimization level or leave commented to use the default # (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols) # OPTIMIZE = 3 @@ -528,6 +531,9 @@ CCOMFLAGS += \ -Wno-self-assign-field endif +ifdef SANITIZE +CCOMFLAGS += -fsanitize=$(SANITIZE) +endif #------------------------------------------------- # include paths @@ -594,6 +600,9 @@ ifdef MAP LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map endif +ifdef SANITIZE +LDFLAGS += -fsanitize=$(SANITIZE) +endif #------------------------------------------------- @@ -684,6 +693,10 @@ LIBS += -lportmidi MIDI_LIB = endif +ifneq (,$(findstring clang,$(CC))) +LIBS += -lstdc++ -lpthread +endif + #------------------------------------------------- # 'default' target needs to go here, before the # include files which define additional targets