Default to the optimized -O3 build; DEBUG=1 for a debug build
Bare 'make -C com' now builds -O3 (optimize.env default flip); the install guides drop OPTIMIZE=1 and document DEBUG=1 for an AddressSanitizer build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
mac/env/optimize.env
vendored
26
mac/env/optimize.env
vendored
@@ -1,16 +1,20 @@
|
||||
|
||||
ifdef OPTIMIZE
|
||||
# Performance build: make OPTIMIZE=1
|
||||
# `override` so a command-line `make OPTIMIZE=1` is remapped to -O3 too;
|
||||
# without it, a command-line assignment wins over this `:=` and the literal
|
||||
# `1` leaks into CXXFLAGS (g++ then treats `1` as an input file).
|
||||
override OPTIMIZE := -O3
|
||||
SANITIZE :=
|
||||
# Build mode. The DEFAULT is an optimized -O3 build (what installs and releases
|
||||
# use). Opt into other modes explicitly:
|
||||
# DEBUG=1 -> debug build: -O0 -g + AddressSanitizer (development)
|
||||
# NOPYTHON=1 -> -O0 -g -DNOPYTHON, no ASan (build without the interpreter)
|
||||
# `override` is used throughout so that a stray command-line or environment
|
||||
# `OPTIMIZE=...` cannot leak into CXXFLAGS: OPTIMIZE is an internal flag string
|
||||
# here, no longer a trigger. (A legacy `make OPTIMIZE=1` still yields -O3, since
|
||||
# it falls through to the optimized default below.)
|
||||
ifdef DEBUG
|
||||
override OPTIMIZE := -O0 -g
|
||||
SANITIZE := -fsanitize=address -fno-omit-frame-pointer
|
||||
else ifdef NOPYTHON
|
||||
OPTIMIZE := -O0 -g -DNOPYTHON
|
||||
override OPTIMIZE := -O0 -g -DNOPYTHON
|
||||
SANITIZE :=
|
||||
else
|
||||
# Debug build (default): includes AddressSanitizer
|
||||
OPTIMIZE := -O0 -g
|
||||
SANITIZE := -fsanitize=address -fno-omit-frame-pointer
|
||||
# Performance build (default).
|
||||
override OPTIMIZE := -O3
|
||||
SANITIZE :=
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user