CMake: only compile usbbus.c when (at least) one USB driver is enabled
This commit is contained in:
parent
b6b356b948
commit
a422ae2211
2 changed files with 4 additions and 3 deletions
|
@ -14,6 +14,7 @@ IF(LIBNFC_DRIVER_PN53X_USB)
|
||||||
FIND_PACKAGE(LIBUSB REQUIRED)
|
FIND_PACKAGE(LIBUSB REQUIRED)
|
||||||
ADD_DEFINITIONS("-DDRIVER_PN53X_USB_ENABLED")
|
ADD_DEFINITIONS("-DDRIVER_PN53X_USB_ENABLED")
|
||||||
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn53x_usb")
|
SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn53x_usb")
|
||||||
|
SET(USB_REQUIRED TRUE)
|
||||||
ENDIF(LIBNFC_DRIVER_PN53X_USB)
|
ENDIF(LIBNFC_DRIVER_PN53X_USB)
|
||||||
|
|
||||||
IF(LIBNFC_DRIVER_ARYGON)
|
IF(LIBNFC_DRIVER_ARYGON)
|
||||||
|
|
|
@ -12,9 +12,9 @@ SET(CHIPS_SOURCES chips/pn53x)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/chips)
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/chips)
|
||||||
|
|
||||||
# Library's buses
|
# Library's buses
|
||||||
IF(LIBUSB_FOUND)
|
IF(USB_REQUIRED)
|
||||||
SET(BUSES_SOURCES buses/usbbus)
|
LIST(APPEND BUSES_SOURCES buses/usbbus)
|
||||||
ENDIF(LIBUSB_FOUND)
|
ENDIF(USB_REQUIRED)
|
||||||
|
|
||||||
IF(UART_REQUIRED)
|
IF(UART_REQUIRED)
|
||||||
LIST(APPEND BUSES_SOURCES buses/uart)
|
LIST(APPEND BUSES_SOURCES buses/uart)
|
||||||
|
|
Loading…
Reference in a new issue