1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-22 22:43:25 +01:00

Fix Makefile assignment bug

When a user provides variable=value as an argument to make, all
assignments to that variable are ignored within the Makefile because the
user has explicitly overrode variable to be "value". This made the
ENABLE_ASAN assignment to be ignored, resulting in Toxic always enabling
ASAN unless you run `make ENABLE_ASAN=disabled`, which is not
documented and not how it's intended to work. This can be fixed by
prefixing the assignment with "override", but to be in line with other
argument assignments we just change the variable name.

See more at:
https://www.gnu.org/software/make/manual/html_node/Overriding.html
This commit is contained in:
Maxim Biro 2021-01-19 20:12:34 -05:00
parent ae94bc593b
commit 973e60ef11
No known key found for this signature in database
GPG Key ID: AB3AD9896472BFA4

View File

@ -28,8 +28,8 @@ else
endif
# Check if LLVM Address Sanitizer is enabled
ENABLE_ASAN := $(shell if [ -z "$(ENABLE_ASAN)" ] || [ "$(ENABLE_ASAN)" = "0" ] ; then echo disabled ; else echo enabled ; fi)
ifneq ($(ENABLE_ASAN), disabled)
ASAN := $(shell if [ -z "$(ENABLE_ASAN)" ] || [ "$(ENABLE_ASAN)" = "0" ] ; then echo disabled ; else echo enabled ; fi)
ifneq ($(ASAN), disabled)
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
endif