mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-16 02:53:03 +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:
parent
ae94bc593b
commit
973e60ef11
4
Makefile
4
Makefile
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user