mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
nvs: enable address sanitizer in host tests when building with clang
This commit is contained in:
parent
d2526e6dda
commit
6afc116036
@ -28,11 +28,23 @@ SOURCE_FILES = \
|
|||||||
crc.cpp \
|
crc.cpp \
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|
||||||
|
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
|
||||||
|
COMPILER := clang
|
||||||
|
else
|
||||||
|
COMPILER := gcc
|
||||||
|
endif
|
||||||
|
|
||||||
CPPFLAGS += -I../include -I../src -I./ -I../../esp_common/include -I../../esp32/include -I ../../mbedtls/mbedtls/include -I ../../spi_flash/include -I ../../soc/include -I ../../xtensa/include -I ../../../tools/catch -fprofile-arcs -ftest-coverage
|
CPPFLAGS += -I../include -I../src -I./ -I../../esp_common/include -I../../esp32/include -I ../../mbedtls/mbedtls/include -I ../../spi_flash/include -I ../../soc/include -I ../../xtensa/include -I ../../../tools/catch -fprofile-arcs -ftest-coverage
|
||||||
CFLAGS += -fprofile-arcs -ftest-coverage
|
CFLAGS += -fprofile-arcs -ftest-coverage
|
||||||
CXXFLAGS += -std=c++11 -Wall -Werror
|
CXXFLAGS += -std=c++11 -Wall -Werror
|
||||||
LDFLAGS += -lstdc++ -Wall -fprofile-arcs -ftest-coverage
|
LDFLAGS += -lstdc++ -Wall -fprofile-arcs -ftest-coverage
|
||||||
|
|
||||||
|
ifeq ($(COMPILER),clang)
|
||||||
|
CFLAGS += -fsanitize=address
|
||||||
|
CXXFLAGS += -fsanitize=address
|
||||||
|
LDFLAGS += -fsanitize=address
|
||||||
|
endif
|
||||||
|
|
||||||
OBJ_FILES = $(SOURCE_FILES:.cpp=.o)
|
OBJ_FILES = $(SOURCE_FILES:.cpp=.o)
|
||||||
|
|
||||||
COVERAGE_FILES = $(OBJ_FILES:.o=.gc*)
|
COVERAGE_FILES = $(OBJ_FILES:.o=.gc*)
|
||||||
|
Loading…
Reference in New Issue
Block a user