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 Jun 22, 2024
1 parent d141e01 commit 4c0bdac
Show file tree
Hide file tree
Showing 6 changed files with 26 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 ]
release:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
set -e
sudo add-apt-repository universe
sudo apt update
sudo apt install -y cmake ninja-build libarchive-dev libzstd-dev zlib1g-dev libgl1-mesa-dev nettle-dev libacl1-dev liblz4-dev libc6-dev
sudo apt install -y cmake ninja-build libarchive-dev libzstd-dev zlib1g-dev libgl1-mesa-dev nettle-dev libacl1-dev liblz4-dev libc6-dev libusb-1.0-0-dev
- name: Install Qt
uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0 # v4
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 ]
release:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Install dependencies
run: |
set -e
brew install libarchive libpng zlib automake autoconf libtool
brew install libarchive libpng zlib automake autoconf libtool libusb
- name: Install Qt
uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0 # v4
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 ]
release:
Expand Down
16 changes: 16 additions & 0 deletions gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ qt_add_executable(CEmu ${MAYBE_MACOSX_BUNDLE}
../../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 @@ -276,6 +278,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)
endif()
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()

if(NOT WIN32 AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/capture/libpng-apng/.libs/libpng16.a")
message(STATUS "Static APNG-enabled LibPNG will be used")
if(TRY_STATIC_DEPS_LDFLAGS MATCHES "libz.a") # already linked before
Expand Down Expand Up @@ -375,11 +389,13 @@ qt_add_resources(CEmu "icons"
"resources/icons/check_update.png"
"resources/icons/checkgray.png"
"resources/icons/clock.png"
"resources/icons/connect.png"
"resources/icons/console.png"
"resources/icons/cpu_status.png"
"resources/icons/debug_control.png"
"resources/icons/debugger.png"
"resources/icons/disasm.png"
"resources/icons/disconnect.png"
"resources/icons/exit.png"
"resources/icons/export.png"
"resources/icons/generic_export.png"
Expand Down
4 changes: 4 additions & 0 deletions gui/qt/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"VCPKG_MANIFEST_INSTALL": {
"type": "BOOL",
"value": "True"
},
"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 @@ -5,6 +5,7 @@
"description": "Developer-oriented emulator of the eZ80-based TI-84 Plus CE / TI-83 Premium CE calculators.",
"dependencies": [
"pkgconf",
"libusb-win32",
{
"name": "libarchive",
"default-features": false
Expand Down

0 comments on commit 4c0bdac

Please sign in to comment.