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