From 9cece8b55db9d703e554ba5db446e7e53e138515 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 8 Jul 2020 13:06:03 +0200 Subject: [PATCH 1/5] add cr --- contrib/win32/getopt.c | 2 +- contrib/win32/getopt.h | 2 +- contrib/win32/nfc.def | 2 +- contrib/win32/nfc_msvc.def | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/win32/getopt.c b/contrib/win32/getopt.c index 5f71021..808be80 100644 --- a/contrib/win32/getopt.c +++ b/contrib/win32/getopt.c @@ -103,4 +103,4 @@ int getopt(int nargc, char * const nargv[], const char *ostr) ++optind; } return (optopt); /* dump back option letter */ -} \ No newline at end of file +} diff --git a/contrib/win32/getopt.h b/contrib/win32/getopt.h index 392d4ff..c895616 100644 --- a/contrib/win32/getopt.h +++ b/contrib/win32/getopt.h @@ -10,4 +10,4 @@ extern char *optarg; /* argument associated with option */ int getopt(int nargc, char * const nargv[], const char *ostr); -#endif \ No newline at end of file +#endif diff --git a/contrib/win32/nfc.def b/contrib/win32/nfc.def index 37cf7fb..2259817 100644 --- a/contrib/win32/nfc.def +++ b/contrib/win32/nfc.def @@ -54,4 +54,4 @@ EXPORTS pn53x_transceive pn532_SAMConfiguration pn53x_read_register - pn53x_write_register \ No newline at end of file + pn53x_write_register diff --git a/contrib/win32/nfc_msvc.def b/contrib/win32/nfc_msvc.def index ffa662d..ec4dc80 100644 --- a/contrib/win32/nfc_msvc.def +++ b/contrib/win32/nfc_msvc.def @@ -54,4 +54,4 @@ EXPORTS pn53x_transceive pn532_SAMConfiguration pn53x_read_register - pn53x_write_register \ No newline at end of file + pn53x_write_register From f56bbabf6cb202ce7b7f14c596ba8a56b8ec1f9c Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 8 Jul 2020 13:06:45 +0200 Subject: [PATCH 2/5] easy reading condition --- cmake/modules/LibnfcDrivers.cmake | 10 +++++----- libnfc/CMakeLists.txt | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmake/modules/LibnfcDrivers.cmake b/cmake/modules/LibnfcDrivers.cmake index 23c322a..7dc2503 100644 --- a/cmake/modules/LibnfcDrivers.cmake +++ b/cmake/modules/LibnfcDrivers.cmake @@ -3,13 +3,13 @@ SET(LIBNFC_DRIVER_ACR122_PCSC OFF CACHE BOOL "Enable ACR122 support (Depends on SET(LIBNFC_DRIVER_ACR122_USB ON CACHE BOOL "Enable ACR122 support (Direct USB connection)") SET(LIBNFC_DRIVER_ACR122S ON CACHE BOOL "Enable ACR122S support (Use serial port)") SET(LIBNFC_DRIVER_ARYGON ON CACHE BOOL "Enable ARYGON support (Use serial port)") -IF(NOT UNIX OR APPLE) - SET(LIBNFC_DRIVER_PN532_I2C OFF CACHE BOOL "Enable PN532 I2C support (Use I2C bus)") - SET(LIBNFC_DRIVER_PN532_SPI OFF CACHE BOOL "Enable PN532 SPI support (Use SPI bus)") -ELSE(NOT UNIX OR APPLE) +IF(UNIX AND NOT APPLE) SET(LIBNFC_DRIVER_PN532_I2C ON CACHE BOOL "Enable PN532 I2C support (Use I2C bus)") SET(LIBNFC_DRIVER_PN532_SPI ON CACHE BOOL "Enable PN532 SPI support (Use SPI bus)") -ENDIF(NOT UNIX OR APPLE) +ELSE(UNIX AND NOT APPLE) + SET(LIBNFC_DRIVER_PN532_I2C OFF CACHE BOOL "Enable PN532 I2C support (Use I2C bus)") + SET(LIBNFC_DRIVER_PN532_SPI OFF CACHE BOOL "Enable PN532 SPI support (Use SPI bus)") +ENDIF(UNIX AND NOT APPLE) SET(LIBNFC_DRIVER_PN532_UART ON CACHE BOOL "Enable PN532 UART support (Use serial port)") SET(LIBNFC_DRIVER_PN53X_USB ON CACHE BOOL "Enable PN531 and PN531 USB support (Depends on libusb)") diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index 3a58a05..2867d4e 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -29,23 +29,23 @@ IF(UART_REQUIRED) ENDIF(UART_REQUIRED) IF(I2C_REQUIRED) - IF(NOT UNIX OR APPLE) + IF(UNIX AND NOT APPLE) + LIST(APPEND BUSES_SOURCES buses/i2c) + ELSE(UNIX AND NOT APPLE) # Only Linux is supported at the moment #LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/i2c) MESSAGE( FATAL_ERROR "I2C is only (yet) supported in Linux!" ) - ELSE(NOT UNIX OR APPLE) - LIST(APPEND BUSES_SOURCES buses/i2c) - ENDIF(NOT UNIX OR APPLE) + ENDIF(UNIX AND NOT APPLE) ENDIF(I2C_REQUIRED) IF(SPI_REQUIRED) - IF(NOT UNIX OR APPLE) + IF(UNIX AND NOT APPLE) + LIST(APPEND BUSES_SOURCES buses/spi) + ELSE(UNIX AND NOT APPLE) # Only Linux is supported at the moment #LIST(APPEND BUSES_SOURCES ../contrib/win32/libnfc/buses/spi) MESSAGE( FATAL_ERROR "SPI is only (yet) supported in Linux!" ) - ELSE(NOT UNIX OR APPLE) - LIST(APPEND BUSES_SOURCES buses/spi) - ENDIF(NOT UNIX OR APPLE) + ENDIF(UNIX AND NOT APPLE) ENDIF(SPI_REQUIRED) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/buses) From d5fcd08d41cc08b98861c040a7eec991e79fb44f Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 8 Jul 2020 13:14:06 +0200 Subject: [PATCH 3/5] remove unused packages --- .travis.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a65f5f1..87667d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ matrix: packages: - libusb-dev - doxygen - - cmake script: - autoreconf -vfi && mkdir build && cd build && ../configure --prefix=$HOME/.local/ && make -j2 && make install @@ -47,7 +46,6 @@ matrix: packages: - libusb-dev - doxygen - - cmake script: - autoreconf -vfi && mkdir build && cd build && ../configure --prefix=$HOME/.local/ && make -j2 && make install @@ -56,8 +54,7 @@ matrix: compiler: - clang before_install: - - brew update - - brew install autoconf automake cmake doxygen gettext libusb libusb-compat m4 pcre2 pkg-config + - brew install doxygen libusb-compat script: - mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=~/.local .. && make -j2 && make install @@ -66,7 +63,6 @@ matrix: compiler: - clang before_install: - - brew update - - brew install autoconf automake doxygen gettext libusb libusb-compat m4 pcre2 pkg-config + - brew install doxygen libusb-compat m4 script: - autoreconf -vfi && mkdir build && cd build && ../configure --prefix=$HOME/.local/ && make -j2 && make install From 5c09dc180a539bb58d81404182aff1373f47288e Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 8 Jul 2020 13:24:26 +0200 Subject: [PATCH 4/5] forget to add linux clang cmake --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index 87667d2..79d024b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,19 @@ matrix: script: cmake -GNinja .. && cmake --build . + - os: linux + dist: bionic + compiler: + - clang + addons: + apt: + packages: + - libusb-dev + - doxygen + - cmake + script: + - mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=~/.local .. && make -j2 && make install + - os: linux dist: bionic compiler: From 1077228fbdfc9486cfb0a50df7703f69c686f338 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 8 Jul 2020 13:26:45 +0200 Subject: [PATCH 5/5] style --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8a4eb9f..c0baedf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ *.lo *.o *~ +.vs/ +CMakeSettings.json Doxyfile INSTALL aclocal.m4 @@ -60,7 +62,3 @@ utils/nfc-mfultralight utils/nfc-read-forum-tag3 utils/nfc-relay-picc utils/nfc-scan-device - -.vs/ - -CMakeSettings.json