From c6657c7c0018a9c521581667998bcb23308b7b80 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Fri, 16 Feb 2024 14:49:38 +0100 Subject: [PATCH] Fix cmake warning CMake Warning (dev) at libnfc/CMakeLists.txt:77 (ADD_LIBRARY): Policy CMP0115 is not set: Source file extensions must be explicit. Run "cmake --help-policy CMP0115" for policy details. Use the cmake_policy command to set the policy and suppress this warning. File: /home/rousseau/Documents/github/libnfc/libnfc/nfc.c This warning is for project developers. Use -Wno-dev to suppress it. --- cmake/modules/LibnfcDrivers.cmake | 20 ++++++++++---------- libnfc/CMakeLists.txt | 24 ++++++++++++------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmake/modules/LibnfcDrivers.cmake b/cmake/modules/LibnfcDrivers.cmake index ee0a46c..99aa4d4 100644 --- a/cmake/modules/LibnfcDrivers.cmake +++ b/cmake/modules/LibnfcDrivers.cmake @@ -16,62 +16,62 @@ SET(LIBNFC_DRIVER_PN53X_USB ON CACHE BOOL "Enable PN531 and PN531 USB support (D IF(LIBNFC_DRIVER_PCSC) FIND_PACKAGE(PCSC REQUIRED) ADD_DEFINITIONS("-DDRIVER_PCSC_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pcsc") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pcsc.c") ENDIF(LIBNFC_DRIVER_PCSC) IF(LIBNFC_DRIVER_ACR122_PCSC) FIND_PACKAGE(PCSC REQUIRED) ADD_DEFINITIONS("-DDRIVER_ACR122_PCSC_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_pcsc") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_pcsc.c") ENDIF(LIBNFC_DRIVER_ACR122_PCSC) IF(LIBNFC_DRIVER_ACR122_USB) FIND_PACKAGE(LIBUSB REQUIRED) ADD_DEFINITIONS("-DDRIVER_ACR122_USB_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_usb") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_usb.c") ENDIF(LIBNFC_DRIVER_ACR122_USB) IF(LIBNFC_DRIVER_ACR122S) ADD_DEFINITIONS("-DDRIVER_ACR122S_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122s") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122s.c") SET(UART_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_ACR122S) IF(LIBNFC_DRIVER_ARYGON) ADD_DEFINITIONS("-DDRIVER_ARYGON_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/arygon") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/arygon.c") SET(UART_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_ARYGON) IF(LIBNFC_DRIVER_PN532_I2C) ADD_DEFINITIONS("-DDRIVER_PN532_I2C_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_i2c") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_i2c.c") SET(I2C_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_PN532_I2C) IF(LIBNFC_DRIVER_PN532_SPI) ADD_DEFINITIONS("-DDRIVER_PN532_SPI_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_spi") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_spi.c") SET(SPI_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_PN532_SPI) IF(LIBNFC_DRIVER_PN532_UART) ADD_DEFINITIONS("-DDRIVER_PN532_UART_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_uart") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn532_uart.c") SET(UART_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_PN532_UART) IF(LIBNFC_DRIVER_PN53X_USB) FIND_PACKAGE(LIBUSB REQUIRED) ADD_DEFINITIONS("-DDRIVER_PN53X_USB_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn53x_usb") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/pn53x_usb.c") SET(USB_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_PN53X_USB) IF(LIBNFC_DRIVER_ACR122_USB) FIND_PACKAGE(LIBUSB REQUIRED) ADD_DEFINITIONS("-DDRIVER_ACR122_USB_ENABLED") - SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_usb") + SET(DRIVERS_SOURCES ${DRIVERS_SOURCES} "drivers/acr122_usb.c") SET(USB_REQUIRED TRUE) ENDIF(LIBNFC_DRIVER_ACR122_USB) diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index 2b4c39c..d332177 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -1,6 +1,6 @@ # Windows MinGW workarounds IF(WIN32) - SET(WINDOWS_SOURCES ../contrib/win32/stdlib) + SET(WINDOWS_SOURCES ../contrib/win32/stdlib.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32) # Add in the rc for version information in the dll @@ -11,39 +11,39 @@ IF(WIN32) ENDIF(WIN32) # Library's chips -SET(CHIPS_SOURCES chips/pn53x) +SET(CHIPS_SOURCES chips/pn53x.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/chips) # Library's buses IF(USB_REQUIRED) - LIST(APPEND BUSES_SOURCES buses/usbbus) + LIST(APPEND BUSES_SOURCES buses/usbbus.c) ENDIF(USB_REQUIRED) IF(UART_REQUIRED) IF(WIN32) # Windows have a special implementation for UART - LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/uart) + LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/uart.c) ELSE(WIN32) - LIST(APPEND BUSES_SOURCES buses/uart) + LIST(APPEND BUSES_SOURCES buses/uart.c) ENDIF(WIN32) ENDIF(UART_REQUIRED) IF(I2C_REQUIRED) IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - LIST(APPEND BUSES_SOURCES buses/i2c) + LIST(APPEND BUSES_SOURCES buses/i2c.c) ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Only Linux is supported at the moment - #LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/i2c) + #LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/i2c.c) MESSAGE( FATAL_ERROR "I2C is only (yet) supported in Linux!" ) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ENDIF(I2C_REQUIRED) IF(SPI_REQUIRED) IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - LIST(APPEND BUSES_SOURCES buses/spi) + LIST(APPEND BUSES_SOURCES buses/spi.c) ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Only Linux is supported at the moment - #LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/spi) + #LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/spi.c) MESSAGE( FATAL_ERROR "SPI is only (yet) supported in Linux!" ) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ENDIF(SPI_REQUIRED) @@ -61,7 +61,7 @@ IF(LIBUSB_FOUND) ENDIF(LIBUSB_FOUND) # Library -SET(LIBRARY_SOURCES nfc nfc-device nfc-emulation nfc-internal conf iso14443-subr mirror-subr target-subr ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES} ${WINDOWS_SOURCES}) +SET(LIBRARY_SOURCES nfc.c nfc-device.c nfc-emulation.c nfc-internal.c conf.c iso14443-subr.c mirror-subr.c target-subr.c ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES} ${WINDOWS_SOURCES}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF(LIBNFC_LOG) @@ -69,9 +69,9 @@ IF(LIBNFC_LOG) IF(MINGW) SET(CMAKE_C_FLAGS "-fgnu89-inline ${CMAKE_C_FLAGS}") ENDIF(MINGW) - LIST(APPEND LIBRARY_SOURCES log ../contrib/win32/libnfc/log-internal) + LIST(APPEND LIBRARY_SOURCES log.c ../contrib/win32/libnfc/log-internal.c) ELSE(WIN32) - LIST(APPEND LIBRARY_SOURCES log log-internal) + LIST(APPEND LIBRARY_SOURCES log.c log-internal.c) ENDIF(WIN32) ENDIF(LIBNFC_LOG) ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES})