Skip to content

Commit eeaca93

Browse files
committed
asd
1 parent 1bb3485 commit eeaca93

5 files changed

Lines changed: 61 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 34 additions & 8 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
@@ -31,23 +39,42 @@ jobs:
3139
with:
3240
version: '6.10.0'
3341
modules: 'qtmultimedia'
42+
arch: ${{ matrix.compiler == 'mingw' && 'win64_mingw' || '' }}
43+
tools: ${{ matrix.compiler == 'mingw' && 'tools_mingw1310' || '' }}
3444

35-
- name: Configure CMake
45+
- name: Configure CMake (MinGW)
46+
if: matrix.compiler == 'mingw'
47+
run: cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install_dir
48+
49+
- name: Configure CMake (MSVC)
50+
if: matrix.compiler == 'msvc'
51+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install_dir
52+
53+
- name: Configure CMake (Unix)
54+
if: runner.os != 'Windows'
3655
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install_dir
3756

38-
- name: Build and Install
57+
- name: Build and Install (MinGW)
58+
if: matrix.compiler == 'mingw'
59+
run: cmake --build build --target install -j 4
60+
61+
- name: Build and Install (MSVC)
62+
if: matrix.compiler == 'msvc'
63+
run: cmake --build build --config Release --target install -j 4
64+
65+
- name: Build and Install (Unix)
66+
if: runner.os != 'Windows'
3967
run: cmake --build build --config Release --target install -j 4
4068

4169
- name: Deploy Qt (Windows)
4270
if: runner.os == 'Windows'
4371
shell: cmd
4472
run: |
45-
windeployqt --release install_dir\bin\adskiller.exe
73+
windeployqt --release --compiler-runtime install_dir\bin\adskiller.exe
4674
4775
- name: Deploy Qt (Linux)
4876
if: runner.os == 'Linux'
4977
run: |
50-
# Copy multimedia plugins manually
5178
QT_PLUGIN_PATH="${Qt6_DIR}/../../../plugins"
5279
if [ -d "$QT_PLUGIN_PATH/multimedia" ]; then
5380
mkdir -p install_dir/lib/plugins/multimedia
@@ -57,7 +84,6 @@ jobs:
5784
- name: Deploy Qt (macOS)
5885
if: runner.os == 'macOS'
5986
run: |
60-
# Run macdeployqt on the shared library location
6187
QT_PLUGIN_PATH="${Qt6_DIR}/../../../plugins"
6288
APP_BUNDLE=$(find install_dir -name "*.app" -maxdepth 1 | head -1)
6389
if [ -n "$APP_BUNDLE" ] && [ -d "$QT_PLUGIN_PATH/multimedia" ]; then
@@ -68,5 +94,5 @@ jobs:
6894
- name: Upload Artifact
6995
uses: actions/upload-artifact@v4
7096
with:
71-
name: pixelblast-${{ runner.os }}
97+
name: adskiller-${{ runner.os }}-${{ matrix.compiler }}
7298
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: 9 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,14 @@ 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(
116+
nullptr,
117+
"Ошибка запуска",
118+
QString(
119+
"Не найден ADB файл:\n%1\n\nУбедитесь, что каталог adb/ с файлом adb.exe "
120+
"находится рядом с исполняемым файлом приложения.")
121+
.arg(adbfile));
114122
return false;
115123
}
116124
return true;

0 commit comments

Comments
 (0)