Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add win32 travis build #870

Merged
merged 8 commits into from
Mar 11, 2020
14 changes: 14 additions & 0 deletions .travis-lin-mingw.sh
Original file line number Diff line number Diff line change
@@ -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

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion cmake/modules/FindLibUSB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down