Skip to content

Commit 931098f

Browse files
committed
asd
1 parent 1bb3485 commit 931098f

5 files changed

Lines changed: 89 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@ on:
99

1010
jobs:
1111
build:
12-
name: Build on ${{ matrix.os }}
12+
name: Build on ${{ matrix.os }} (${{ matrix.compiler }})
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os: [ubuntu-latest, windows-latest, macos-latest]
17+
include:
18+
- os: ubuntu-latest
19+
compiler: gcc
20+
- os: windows-latest
21+
compiler: msvc
22+
- os: windows-latest
23+
compiler: mingw
24+
- os: macos-latest
25+
compiler: clang
1826

1927
steps:
2028
- name: Checkout Code
@@ -26,28 +34,77 @@ jobs:
2634
sudo apt-get update
2735
sudo apt-get install -y libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libx11-xcb-dev libxcb-glx0-dev
2836
37+
# MinGW: install everything (compiler + Qt) through MSYS2 for consistency
38+
- name: Install MSYS2 MinGW toolchain and Qt
39+
if: matrix.compiler == 'mingw'
40+
uses: msys2/setup-msys2@v2
41+
with:
42+
msystem: MINGW64
43+
update: true
44+
install: >-
45+
mingw-w64-x86_64-gcc
46+
mingw-w64-x86_64-cmake
47+
mingw-w64-x86_64-ninja
48+
mingw-w64-x86_64-qt6-base
49+
mingw-w64-x86_64-qt6-declarative
50+
mingw-w64-x86_64-qt6-multimedia
51+
mingw-w64-x86_64-qt6-tools
52+
53+
# Non-MinGW platforms: install Qt via install-qt-action
2954
- name: Install Qt
55+
if: matrix.compiler != 'mingw'
3056
uses: jurplel/install-qt-action@v4
3157
with:
3258
version: '6.10.0'
3359
modules: 'qtmultimedia'
3460

35-
- name: Configure CMake
61+
# --- Configure ---
62+
- name: Configure CMake (MinGW)
63+
if: matrix.compiler == 'mingw'
64+
shell: msys2 {0}
65+
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install_dir
66+
67+
- name: Configure CMake (MSVC)
68+
if: matrix.compiler == 'msvc'
69+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install_dir
70+
71+
- name: Configure CMake (Unix)
72+
if: runner.os != 'Windows'
3673
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install_dir
3774

38-
- name: Build and Install
75+
# --- Build & Install ---
76+
- name: Build and Install (MinGW)
77+
if: matrix.compiler == 'mingw'
78+
shell: msys2 {0}
79+
run: cmake --build build --target install -j 4
80+
81+
- name: Build and Install (MSVC)
82+
if: matrix.compiler == 'msvc'
83+
run: cmake --build build --config Release --target install -j 4
84+
85+
- name: Build and Install (Unix)
86+
if: runner.os != 'Windows'
3987
run: cmake --build build --config Release --target install -j 4
4088

41-
- name: Deploy Qt (Windows)
42-
if: runner.os == 'Windows'
89+
# --- Deploy ---
90+
- name: Deploy Qt (Windows MSVC)
91+
if: matrix.compiler == 'msvc'
4392
shell: cmd
4493
run: |
4594
windeployqt --release install_dir\bin\adskiller.exe
4695
96+
- name: Deploy Qt (Windows MinGW)
97+
if: matrix.compiler == 'mingw'
98+
shell: msys2 {0}
99+
run: |
100+
windeployqt --release --compiler-runtime install_dir/bin/adskiller.exe
101+
# windeployqt in MSYS2 misses transitive 3rd-party dependencies (icu, zstd, pcre2, etc.)
102+
# Use ldd to find all required mingw64 DLLs and copy them to the bin folder
103+
ldd install_dir/bin/adskiller.exe | grep -i '\/mingw64\/bin\/.*\.dll' | awk '{print $3}' | xargs -I '{}' cp -v '{}' install_dir/bin/
104+
47105
- name: Deploy Qt (Linux)
48106
if: runner.os == 'Linux'
49107
run: |
50-
# Copy multimedia plugins manually
51108
QT_PLUGIN_PATH="${Qt6_DIR}/../../../plugins"
52109
if [ -d "$QT_PLUGIN_PATH/multimedia" ]; then
53110
mkdir -p install_dir/lib/plugins/multimedia
@@ -57,7 +114,6 @@ jobs:
57114
- name: Deploy Qt (macOS)
58115
if: runner.os == 'macOS'
59116
run: |
60-
# Run macdeployqt on the shared library location
61117
QT_PLUGIN_PATH="${Qt6_DIR}/../../../plugins"
62118
APP_BUNDLE=$(find install_dir -name "*.app" -maxdepth 1 | head -1)
63119
if [ -n "$APP_BUNDLE" ] && [ -d "$QT_PLUGIN_PATH/multimedia" ]; then
@@ -68,5 +124,5 @@ jobs:
68124
- name: Upload Artifact
69125
uses: actions/upload-artifact@v4
70126
with:
71-
name: pixelblast-${{ runner.os }}
127+
name: adskiller-${{ runner.os }}-${{ matrix.compiler }}
72128
path: install_dir/

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,19 @@ file(GLOB UPDATE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/update/*" "${CMAKE_CURRENT
3939

4040
if(WIN32)
4141
file(COPY "${CMAKE_SOURCE_DIR}/3rdParty/adb" DESTINATION "${CMAKE_BINARY_DIR}")
42+
# Also copy adb to multi-config output dirs (e.g. Release/, Debug/) for MSVC
43+
file(COPY "${CMAKE_SOURCE_DIR}/3rdParty/adb" DESTINATION "${CMAKE_BINARY_DIR}/Release")
44+
file(COPY "${CMAKE_SOURCE_DIR}/3rdParty/adb" DESTINATION "${CMAKE_BINARY_DIR}/Debug")
4245
set(PROJECT_SOURCES ${PROJECT_SOURCES} "${CMAKE_SOURCE_DIR}/adskiller.rc")
4346
set(UPDATE_SOURCES ${UPDATE_SOURCES} "${CMAKE_SOURCE_DIR}/update.rc")
4447
endif()
4548

4649
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
50+
# Redirect QML module output to avoid name collision with the executable
51+
# on case-insensitive filesystems (macOS/Windows): URI "Adskiller" directory
52+
# would clash with OUTPUT_NAME "adskiller"
53+
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml")
54+
4755
qt_add_executable(application
4856
MANUAL_FINALIZATION
4957
${PROJECT_SOURCES}
@@ -122,5 +130,9 @@ install(TARGETS application
122130
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
123131
)
124132

133+
if(WIN32)
134+
install(DIRECTORY "${CMAKE_SOURCE_DIR}/3rdParty/adb" DESTINATION ${CMAKE_INSTALL_BINDIR})
135+
endif()
136+
125137
qt_finalize_executable(application)
126138
qt_finalize_executable(update)

src/common/adbfront/include/adbcmds.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

3-
#ifdef __linux__
3+
#if defined(__linux__) || defined(__APPLE__)
44
constexpr const char AdbFilename[] = "adb";
5-
#elif WIN32
5+
#elif defined(WIN32)
66
constexpr const char AdbFilename[] = "adb.exe";
77
#endif
88

src/common/adbfront/src/adbfront.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
QString AdbExecutableFilename()
1515
{
1616
QString adbFile;
17-
#ifdef WIN32
17+
#if defined(WIN32)
1818
adbFile = QCoreApplication::applicationDirPath() + "/adb/";
19-
#elif __linux__
19+
#elif defined(__APPLE__)
20+
adbFile = QCoreApplication::applicationDirPath() + "/";
21+
#elif defined(__linux__)
2022
adbFile = "/usr/bin/";
2123
#endif
2224
adbFile += AdbFilename;

src/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <QDataStream>
44
#include <QDir>
55
#include <QFile>
6+
#include <QMessageBox>
67
#include <QSharedMemory>
78
#include <QQmlApplicationEngine>
89
#include <QQmlContext>
@@ -110,7 +111,11 @@ bool checkout()
110111
QString adbfile = AdbExecutableFilename();
111112
if(!qdir.exists(adbfile))
112113
{
113-
qDebug() << "Adb not found";
114+
qDebug() << "Adb not found:" << adbfile;
115+
QMessageBox::critical(nullptr, "Ошибка запуска",
116+
QString("Не найден ADB файл:\n%1\n\nУбедитесь, что каталог adb/ с файлом adb.exe "
117+
"находится рядом с исполняемым файлом приложения.")
118+
.arg(adbfile));
114119
return false;
115120
}
116121
return true;

0 commit comments

Comments
 (0)