mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
nvs_flash: link the host test against libbsd when building on Linux
...and clean up the linking rule
This commit is contained in:
parent
7a1e19edf1
commit
4e0fa26e64
@ -43,6 +43,10 @@ CFLAGS += -fprofile-arcs -ftest-coverage -DLINUX_TARGET -DLINUX_HOST_LEGACY_TEST
|
||||
CXXFLAGS += -std=c++11 -Wall -Werror -DLINUX_TARGET -DLINUX_HOST_LEGACY_TEST
|
||||
LDFLAGS += -lstdc++ -Wall -fprofile-arcs -ftest-coverage
|
||||
|
||||
ifeq ($(shell uname -s),Linux)
|
||||
LDFLAGS += -lbsd
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER),clang)
|
||||
CFLAGS += -fsanitize=address
|
||||
CXXFLAGS += -fsanitize=address
|
||||
@ -53,13 +57,16 @@ OBJ_FILES = $(SOURCE_FILES:.cpp=.o)
|
||||
OBJ_FILES_C = $(SOURCE_FILES_C:.c=.o)
|
||||
|
||||
COVERAGE_FILES = $(OBJ_FILES:.o=.gc*)
|
||||
MBEDTLS_LIB := ../../mbedtls/mbedtls/library/libmbedcrypto.a
|
||||
|
||||
$(OBJ_FILES): %.o: %.cpp
|
||||
$(OBJ_FILES_C): %.c: %.c
|
||||
|
||||
$(TEST_PROGRAM): clean-coverage $(OBJ_FILES) $(OBJ_FILES_C)
|
||||
$(MBEDTLS_LIB):
|
||||
$(MAKE) -C ../../mbedtls/mbedtls/ lib
|
||||
g++ $(LDFLAGS) -o $(TEST_PROGRAM) $(OBJ_FILES) $(OBJ_FILES_C) ../../mbedtls/mbedtls/library/libmbedcrypto.a
|
||||
|
||||
$(TEST_PROGRAM): $(OBJ_FILES) $(OBJ_FILES_C) $(MBEDTLS_LIB) | clean-coverage
|
||||
g++ -o $@ $^ $(LDFLAGS)
|
||||
|
||||
$(OUTPUT_DIR):
|
||||
mkdir -p $(OUTPUT_DIR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user