diff --git a/.travis-lin-mingw.sh b/.travis-lin-mingw.sh new file mode 100755 index 000000000..0422a06f6 --- /dev/null +++ b/.travis-lin-mingw.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +DIR=$PWD + +if [ "$TRAVIS_OS_NAME" == "linux" ]; then + echo "WORK DIR:$DIR" + mkdir -p $DIR/build/linux-mingw32-release + cd $DIR/build/linux-mingw32-release + echo "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$PWD/_install $DIR" + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake -DCMAKE_INSTALL_PREFIX=$PWD/_install $DIR + echo "make" + make +fi + diff --git a/.travis.yml b/.travis.yml index b0f985012..b1832d57f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,12 @@ addons: - g++-6 - gcc-6 - libusb-1.0.0-dev + - p7zip + - mingw-w64 script: - git fetch --tags - printenv - cmake --version - ./.travis.sh + - ./.travis-lin-mingw.sh diff --git a/cmake/modules/FindLibUSB.cmake b/cmake/modules/FindLibUSB.cmake index 5233e489d..2ad35b3d8 100644 --- a/cmake/modules/FindLibUSB.cmake +++ b/cmake/modules/FindLibUSB.cmake @@ -84,7 +84,8 @@ if(NOT LIBUSB_FOUND) file(MAKE_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}) if(${ZIP_EXECUTABLE} MATCHES "p7zip") - execute_process(COMMAND ${ZIP_EXECUTABLE} -d --keep -f ${LIBUSB_WIN_ARCHIVE_PATH} WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}) + #execute_process(COMMAND ${ZIP_EXECUTABLE} -d --keep -f ${LIBUSB_WIN_ARCHIVE_PATH} WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}) + execute_process(COMMAND ${ZIP_EXECUTABLE} -d ${LIBUSB_WIN_ARCHIVE_PATH} WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}) else() execute_process(COMMAND ${ZIP_EXECUTABLE} x -y ${LIBUSB_WIN_ARCHIVE_PATH} -o${LIBUSB_WIN_OUTPUT_FOLDER}) endif() diff --git a/src/usb.c b/src/usb.c index 9df9d7296..81bd7ae2c 100644 --- a/src/usb.c +++ b/src/usb.c @@ -189,7 +189,7 @@ int _stlink_usb_version(stlink_t *sl) { cmd[i++] = STLINK_APIV3_GET_VERSION_EX; size = send_recv(slu, 1, cmd, slu->cmd_len, data, rep_len); - if (size != rep_len) { + if (size != (ssize_t)rep_len) { printf("[!] send_recv STLINK_APIV3_GET_VERSION_EX\n"); return (int) size; }