CI: Fix windows build
This commit is contained in:
parent
a48d25719d
commit
61f82e38c6
|
@ -6,16 +6,16 @@ jobs:
|
||||||
Build:
|
Build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Get Libusb for windows
|
- name: Check out repository code
|
||||||
run: wget https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z -o ${{ gitea.workspace }}/libusb.7z; ls ${{ gitea.workspace }}
|
uses: ischanx/checkout@8c80eac3058d03dc5301629e8f7d59ae255d6cc3
|
||||||
- name: Install dependancies
|
- name: Install dependancies
|
||||||
run: |
|
run: |
|
||||||
apt update
|
apt update
|
||||||
apt install -y cmake mingw-w64-x86-64-dev gcc-mingw-w64 g++-mingw-w64 p7zip-full
|
apt install -y cmake mingw-w64-x86-64-dev gcc-mingw-w64 g++-mingw-w64 p7zip-full
|
||||||
mkdir ${{ gitea.workspace }}/libusb
|
cd ${{ gitea.workspace }}
|
||||||
7z x ${{ gitea.workspace }}/libusb.7z -o${{ gitea.workspace }}/libusb
|
wget https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z
|
||||||
- name: Check out repository code
|
mkdir libusb
|
||||||
uses: ischanx/checkout@8c80eac3058d03dc5301629e8f7d59ae255d6cc3
|
7z x libusb-1.0.29.7z -olibusb
|
||||||
- name: Version
|
- name: Version
|
||||||
id: version
|
id: version
|
||||||
run: git fetch -a; echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
run: git fetch -a; echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
||||||
|
|
|
@ -57,6 +57,9 @@ endif(WIN32)
|
||||||
add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
|
add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${LIBUSB_INCLUDE_DIRS})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${LIBUSB_INCLUDE_DIRS})
|
||||||
target_link_libraries(${PROJECT_NAME} ${LIBUSB_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} ${LIBUSB_LIBRARIES})
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(${PROJECT_NAME} libpthread.a)
|
||||||
|
endif(WIN32)
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -O2 -fno-strict-aliasing)
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -O2 -fno-strict-aliasing)
|
||||||
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
||||||
install(FILES ./eismultiplexer.h DESTINATION include)
|
install(FILES ./eismultiplexer.h DESTINATION include)
|
||||||
|
@ -64,6 +67,9 @@ install(FILES ./eismultiplexer.h DESTINATION include)
|
||||||
add_library(${PROJECT_NAME}_static STATIC ${SRC_FILES})
|
add_library(${PROJECT_NAME}_static STATIC ${SRC_FILES})
|
||||||
target_include_directories(${PROJECT_NAME}_static PUBLIC ${LIBUSB_INCLUDE_DIRS})
|
target_include_directories(${PROJECT_NAME}_static PUBLIC ${LIBUSB_INCLUDE_DIRS})
|
||||||
target_link_libraries(${PROJECT_NAME}_static ${LIBUSB_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME}_static ${LIBUSB_LIBRARIES})
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(${PROJECT_NAME}_static libpthread.a)
|
||||||
|
endif(WIN32)
|
||||||
target_compile_options(${PROJECT_NAME}_static PRIVATE -Wall -O2 -fno-strict-aliasing)
|
target_compile_options(${PROJECT_NAME}_static PRIVATE -Wall -O2 -fno-strict-aliasing)
|
||||||
install(TARGETS ${PROJECT_NAME}_static DESTINATION lib)
|
install(TARGETS ${PROJECT_NAME}_static DESTINATION lib)
|
||||||
|
|
||||||
|
|
2
usbshm.c
2
usbshm.c
|
@ -38,7 +38,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static int object_counter = 0;
|
static int object_counter = 0;
|
||||||
|
|
2
usbshm.h
2
usbshm.h
|
@ -25,7 +25,7 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
Loading…
Reference in a new issue