File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,21 @@ CXX ?= clang++
22CABIN_TIDY ?= clang-tidy
33PREFIX ?= /usr/local
44INSTALL ?= install
5+ BUILD ?= dev
56COMMIT_HASH ?= $(shell git rev-parse HEAD)
67COMMIT_SHORT_HASH ?= $(shell git rev-parse --short=8 HEAD)
78COMMIT_DATE ?= $(shell git show -s --date=format-local:'% Y-% m-% d' --format=% cd)
89
910CXXFLAGS := -std=c++$(shell grep -m1 edition cabin.toml | cut -f 2 -d'"')
1011CXXFLAGS += -fdiagnostics-color
1112CXXFLAGS += $(shell grep cxxflags cabin.toml | head -n 1 | sed 's/cxxflags = \[//; s/\]//; s/"//g' | tr ',' ' ')
12- ifeq ($(BUILD ) ,release)
13- CXXFLAGS += -O3 -DNDEBUG -flto
14- LDFLAGS += -flto
13+ ifeq ($(BUILD ) ,dev)
14+ CXXFLAGS += -g -O0 -DDEBUG
15+ else ifeq ($(BUILD),release)
16+ CXXFLAGS += -O3 -DNDEBUG -flto
17+ LDFLAGS += -flto
1518else
16- CXXFLAGS += -g -O0 -DDEBUG
19+ $( error "Unknown BUILD : ` $( BUILD ) '. Use `dev' or `release'.")
1720endif
1821TEST_CXXFLAGS := $(CXXFLAGS ) -fsanitize=undefined
1922TEST_LDFLAGS := $(LDFLAGS ) -fsanitize=undefined
You can’t perform that action at this time.
0 commit comments