Skip to content

Commit

Permalink
fix cmake and ci for libusb branch
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Sep 30, 2024
1 parent d4b037f commit 6ba6b59
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.linux.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build Linux

on:
push:
branches: [ master, feature/github-actions ]
branches: [ master, feature/github-actions, test/libusb ]
pull_request:
branches: [ master, feature/github-actions ]

Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install dependencies
run: |
set -e
sudo apt install -y autoconf automake autoconf-archive '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev
sudo apt install -y autoconf automake autoconf-archive '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev libudev-dev libusb-1.0-0-dev
- name: Install latest CMake
uses: lukka/get-cmake@a70f1cfa1857a3eecfe0d34962269e1b1e8be56c # latest as of 2024-08-08
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.mac.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build macOS

on:
push:
branches: [ master, feature/github-actions ]
branches: [ master, feature/github-actions, test/libusb ]
pull_request:
branches: [ master, feature/github-actions ]

Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: |
set -e
brew install automake autoconf libtool
brew install automake autoconf libtool libusb
- name: Install latest CMake
uses: lukka/get-cmake@a70f1cfa1857a3eecfe0d34962269e1b1e8be56c # latest as of 2024-08-08
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.windows.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build Windows

on:
push:
branches: [ master, feature/github-actions ]
branches: [ master, feature/github-actions, test/libusb ]
pull_request:
branches: [ master, feature/github-actions ]

Expand Down
14 changes: 14 additions & 0 deletions gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ set(CEmu_Sources
../../core/usb/disconnected.c
../../core/usb/dusb.c
../../core/usb/fotg210.h
../../core/usb/msd.c
../../core/usb/physical.c
../../core/usb/usb.c ../../core/usb/usb.h
../../core/vat.c ../../core/vat.h
../../tests/autotester/autotester.cpp ../../tests/autotester/autotester.h
Expand Down Expand Up @@ -268,6 +270,18 @@ else()
message(WARNING "No LibArchive found! CE Bundle extraction/transfer will not be available")
endif()

if(PkgConfig_FOUND)
pkg_check_modules(LibUsb libusb-1.0>=1.0.16)
if(LibUsb_FOUND)
target_compile_definitions(CEmu PRIVATE "LIBUSB_SUPPORT")
target_include_directories(CEmu PRIVATE ${LibUsb_INCLUDE_DIRS})
target_link_directories(CEmu PRIVATE ${LibUsb_LIBRARY_DIRS})
target_link_libraries(CEmu PRIVATE ${LibUsb_LIBRARIES})
else()
message(WARNING "No LibUsb found! Some USB things will not be available")
endif()
endif()

find_package(PNG QUIET)
if(PNG_FOUND)
target_compile_definitions(CEmu PRIVATE "PNG_SUPPORT")
Expand Down
4 changes: 4 additions & 0 deletions gui/qt/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
"VCPKG_OVERLAY_TRIPLETS": {
"type": "STRING",
"value": "${sourceDir}/triplets"
},
"VCPKG_INSTALL_OPTIONS": {
"type": "STRING",
"value": "--allow-unsupported"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions gui/qt/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": [
"pkgconf",
"libiconv",
"libusb",
{
"name": "libarchive",
"default-features": false
Expand Down

0 comments on commit 6ba6b59

Please sign in to comment.