hosted: Cleaned up the CFLAGS and LDFLAGS building to use pkg-config to find libusb1 and corrected the pkg-config presence check

This commit is contained in:
dragonmux 2022-08-05 01:20:36 +01:00 committed by Piotr Esden-Tempski
parent 3dadd64f9b
commit 7cacdab98e
1 changed files with 4 additions and 5 deletions

View File

@ -49,15 +49,14 @@ else ifneq (filter, macosx darwin, $(SYS))
endif
ifneq ($(HOSTED_BMP_ONLY), 1)
ifneq ($(shell pkg-config --exists libusb; echo $$?), 0)
$(error Please install libusb dependency or set HOSTED_BMP_ONLY to 1)
ifneq ($(shell pkg-config --exists libusb-1.0; echo $$?), 0)
$(error Please install libusb-1.0 dependency or set HOSTED_BMP_ONLY to 1)
endif
ifneq ($(shell pkg-config --exists libftdi1; echo $$?), 0)
$(error Please install libftdi1 dependency or set HOSTED_BMP_ONLY to 1)
endif
LDFLAGS += -lusb-1.0
CFLAGS += $(shell pkg-config --cflags libftdi1)
LDFLAGS += $(shell pkg-config --libs libftdi1)
CFLAGS += $(shell pkg-config --cflags libusb-1.0) $(shell pkg-config --cflags libftdi1)
LDFLAGS += $(shell pkg-config --libs libusb-1.0) $(shell pkg-config --libs libftdi1)
CFLAGS += -Wno-missing-field-initializers
endif