optional asan

This commit is contained in:
sfja 2026-03-23 22:31:31 +01:00
parent 1bb916de62
commit a955c01fc2

View File

@ -3,7 +3,6 @@ MAKEFLAGS += -j16
CXX=g++ CXX=g++
LD=g++ LD=g++
CLANG_FORMAT=clang-format
CXXFLAGS = -std=c++23 -pedantic-errors -Wall -Wextra -Wconversion CXXFLAGS = -std=c++23 -pedantic-errors -Wall -Wextra -Wconversion
LDFLAGS = LDFLAGS =
@ -23,11 +22,14 @@ else
ifeq ($(GDB),1) ifeq ($(GDB),1)
CXXFLAGS += -ggdb CXXFLAGS += -ggdb
else
CXXFLAGS += -fsanitize=address
endif endif
endif endif
ASAN = 0
ifeq ($(ASAN),1)
CXXFLAGS += -fsanitize=address
endif
build_dir = build build_dir = build
obj_dir = $(build_dir)/obj obj_dir = $(build_dir)/obj
src_dir = src src_dir = src
@ -64,10 +66,10 @@ $(build_dir)/$(test_dir)/test_%: $(test_objects) $(objects_without_main)
$(LD) -o $@ $(CXXFLAGS) $(LDFLAGS) $^ $(LD) -o $@ $(CXXFLAGS) $(LDFLAGS) $^
format: format:
$(CLANG_FORMAT) -style=file -i src/* clang-format -style=file -i src/*
check: check:
$(CLANG_FORMAT) --dry-run --Werror -style=file src/* clang-format --dry-run --Werror -style=file src/*
clean: clean:
rm -rf $(build_dir) rm -rf $(build_dir)