Skip to content

Commit 659b396

Browse files
committed
Libcheck path detection for unit tests in darwin
1 parent 7c34b7c commit 659b396

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ ifneq ($(WOLFSSL_PREFIX),)
1515
CFLAGS+=-I$(WOLFSSL_PREFIX)/include
1616
LDFLAGS+=-L$(WOLFSSL_PREFIX)/lib
1717
endif
18+
CHECK_PREFIX?=$(shell brew --prefix check 2>/dev/null)
19+
ifneq ($(CHECK_PREFIX),)
20+
UNIT_CFLAGS+=-I$(CHECK_PREFIX)/include
21+
UNIT_LDFLAGS+=-L$(CHECK_PREFIX)/lib
22+
endif
1823
endif
1924
TAP_SRC:=src/port/posix/tap_$(UNAME_LC).c
2025
ifeq ($(wildcard $(TAP_SRC)),)
@@ -197,9 +202,9 @@ unit: build/test/unit
197202
build/test/unit:
198203
@mkdir -p build/test/
199204
@echo "[CC] unit.c"
200-
@$(CC) $(CFLAGS) -c src/test/unit/unit.c -o build/test/unit.o
205+
@$(CC) $(CFLAGS) $(UNIT_CFLAGS) -c src/test/unit/unit.c -o build/test/unit.o
201206
@echo "[LD] $@"
202-
@$(CC) -o build/test/unit build/test/unit.o $(LDFLAGS)
207+
@$(CC) $(UNIT_LDFLAGS) $(LDFLAGS) build/test/unit.o -o build/test/unit
203208

204209
# Install dynamic library to re-link linux applications
205210
#

0 commit comments

Comments
 (0)