Skip to content

Commit

Permalink
Fix bugs disturbing in CI building
Browse files Browse the repository at this point in the history
  • Loading branch information
donarturo11 committed Jun 12, 2024
1 parent 5ff8476 commit 4aa4307
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- { name: "windows", os: windows-latest, flags: '-G"Visual Studio 17 2022"', shell: 'msys2 {0}', deps-prefix: "/opt/deps", aqt-os: "windows", aqt-arch: "win64_msvc2019_64", aqt-prefix: "/opt/Qt", aqt-subdir: "msvc2019_64", qt-version: '6.5.1', msystem: 'UCRT64' }
- { name: "windows-legacy", os: windows-latest, flags: "", shell: 'msys2 {0}', deps-prefix: "/opt/deps", aqt-os: "windows", aqt-arch: "win64_mingw81", aqt-prefix: "/opt/Qt", aqt-subdir: "mingw81_64", qt-version: '5.15.2', msystem: 'MINGW64' }
- { name: "linux", os: ubuntu-latest, flags: "", shell: 'bash', deps-prefix: "/home/runner/deps", aqt-os: "linux", aqt-arch: "gcc_64", aqt-prefix: "/home/runner/Qt", aqt-subdir: "gcc_64", qt-version: '6.5.1'}
- { name: "macos-universal", os: macos-latest, flags: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64;arm64\"", shell: 'bash', deps-prefix: "/Users/runner/deps", aqt-os: "mac", aqt-arch: "", aqt-prefix: "/Users/runner/Qt", aqt-subdir: "macos", qt-version: '6.5.1'}
- { name: "macos-legacy", os: macos-latest, flags: "-DCMAKE_OSX_DEPLOYMENT_TARGET=\"10.13\"", shell: 'bash', deps-prefix: "/Users/runner/deps", aqt-os: "mac", aqt-arch: "", aqt-prefix: "/Users/runner/Qt", aqt-subdir: "clang_64", qt-version: '5.15.2' }
- { name: "macos-universal", os: macos-12, flags: "-DCMAKE_OSX_ARCHITECTURES=\"x86_64;arm64\"", shell: 'bash', deps-prefix: "/Users/runner/deps", aqt-os: "mac", aqt-arch: "", aqt-prefix: "/Users/runner/Qt", aqt-subdir: "macos", qt-version: '6.5.1'}
- { name: "macos-legacy", os: macos-12, flags: "-DCMAKE_OSX_DEPLOYMENT_TARGET=\"10.13\"", shell: 'bash', deps-prefix: "/Users/runner/deps", aqt-os: "mac", aqt-arch: "", aqt-prefix: "/Users/runner/Qt", aqt-subdir: "clang_64", qt-version: '5.15.2' }
runs-on: ${{matrix.os}}
defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ option(FORCE_QT6 "Force qt6 install" OFF)

if(FORCE_QT5)
set(QT_VERSION_MAJOR 5)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Bluetooth SerialPort Network)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Bluetooth SerialPort Charts Network)
elseif(FORCE_QT6)
set(QT_VERSION_MAJOR 6)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Bluetooth SerialPort Network)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Bluetooth SerialPort Charts Network)
else()
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets Bluetooth SerialPort Charts Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Bluetooth SerialPort Charts Network)
Expand Down
9 changes: 7 additions & 2 deletions src/QBrainwaveInterface/DeviceConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ class DeviceConnection : public QObject
}
virtual void setupConnection(QVariantMap) = 0;
virtual void open() {
if(_dev->open(QIODeviceBase::ReadWrite)) {
#ifdef QT6
auto open_opt = QIODeviceBase::ReadWrite;
#else
auto open_opt = QIODevice::ReadWrite;
#endif
if(_dev->open(open_opt)) {
connect(_dev, SIGNAL(readyRead()),
this, SLOT(onReadyRead()));
_status = Device::ConnectionStatus::Connected;
Expand Down Expand Up @@ -57,7 +62,7 @@ public slots:
}
}
signals:
void connectionStatusChanged(Device::ConnectionStatus _status);
void connectionStatusChanged(Brainwave::Device::ConnectionStatus _status);
void bytesReceived(const char*, int);
};

Expand Down

0 comments on commit 4aa4307

Please sign in to comment.