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
CXXFLAGS += -D $(LOG_LEVEL)
# CXXFLAGS += -fsanitize=address
CXXFLAGS += -fconcepts-diagnostics-depth=2
SRC = $(wildcard *.cpp) $(wildcard */*.cpp)
# OBJECTS = $(SRC:%.cpp=$(OBJECT_DIR)/%.o)
@ -24,8 +26,11 @@ OBJECT_DIRS = $(foreach dir,$(SRCDIRS), $(OBJECT_DIR)/$(dir))
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)
echo $(OBJECTS)
.PHONY: release
release: CXXFLAGS += -O3
@ -39,7 +44,8 @@ $(EXEC): $(OBJECT_DIRS) $(OBJECTS)
# rule for all ../build/*.o files
$(OBJECT_DIR)/%.o: $(shell echo $<) %.cpp
$(CXX) -c $< -o $@ $(CXXFLAGS) $(LDFLAGS)
@printf $(FMT_MESSAGE) "Building:" $< "->" $@
@$(CXX) -c $< -o $@ $(CXXFLAGS) $(LDFLAGS)
$(OBJECT_DIRS):
mkdir -p $@