Added address sanitizer

This commit is contained in:
matthias@arch 2022-11-14 23:00:40 +01:00
parent c84c12b9e4
commit d5b5f93ed6

View File

@ -16,6 +16,8 @@ EXEC = ../vulkan_test
LOG_LEVEL = LOG_LEVEL_0 LOG_LEVEL = LOG_LEVEL_0
CXXFLAGS += -D $(LOG_LEVEL) CXXFLAGS += -D $(LOG_LEVEL)
# CXXFLAGS += -fsanitize=address
CXXFLAGS += -fconcepts-diagnostics-depth=2
SRC = $(wildcard *.cpp) $(wildcard */*.cpp) SRC = $(wildcard *.cpp) $(wildcard */*.cpp)
# OBJECTS = $(SRC:%.cpp=$(OBJECT_DIR)/%.o) # OBJECTS = $(SRC:%.cpp=$(OBJECT_DIR)/%.o)
@ -24,12 +26,15 @@ OBJECT_DIRS = $(foreach dir,$(SRCDIRS), $(OBJECT_DIR)/$(dir))
DEPENDS = ${OBJECTS:.o=.d} DEPENDS = ${OBJECTS:.o=.d}
FMT_MESSAGE="\e[1;34m%s\e[0m %s %s %s\n"
default:
@printf $(FMT_MESSAGE) "CXXFLAGS = " $(CXXFLAGS)
@printf $(FMT_MESSAGE) "LDFLAGS = " $(LDFLAGS)
default: $(EXEC) default: $(EXEC)
echo $(OBJECTS)
.PHONY: release .PHONY: release
release: CXXFLAGS += -O3 release: CXXFLAGS += -O3
release : default release: default
# rule for the executable # rule for the executable
$(EXEC): $(OBJECT_DIRS) $(OBJECTS) $(EXEC): $(OBJECT_DIRS) $(OBJECTS)
@ -39,7 +44,8 @@ $(EXEC): $(OBJECT_DIRS) $(OBJECTS)
# rule for all ../build/*.o files # rule for all ../build/*.o files
$(OBJECT_DIR)/%.o: $(shell echo $<) %.cpp $(OBJECT_DIR)/%.o: $(shell echo $<) %.cpp
$(CXX) -c $< -o $@ $(CXXFLAGS) $(LDFLAGS) @printf $(FMT_MESSAGE) "Building:" $< "->" $@
@$(CXX) -c $< -o $@ $(CXXFLAGS) $(LDFLAGS)
$(OBJECT_DIRS): $(OBJECT_DIRS):
mkdir -p $@ mkdir -p $@