Skip to content

Commit

Permalink
Merge pull request #571 from psieg/qt
Browse files Browse the repository at this point in the history
Update to Qt6 for windows builds
  • Loading branch information
psieg authored Jan 22, 2023
2 parents a3c32be + 91b00c2 commit 8021e81
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 38 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,13 @@ jobs:
submodules: recursive
- run: choco install --no-progress openssl
- uses: ilammy/msvc-dev-cmd@v1
- name: Cached Qt
id: cache-qt
uses: actions/cache@v2
with:
path: C:\Qt
key: ${{ runner.os }}-qt
- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
cache: true
dir: C:\Qt
modules: serialport
version: 6.*
modules: qtserialport
- name: Cached Bass
id: cache-bass
uses: actions/cache@v2
Expand Down Expand Up @@ -160,7 +155,7 @@ jobs:
- name: Build
shell: cmd
run: |
set QTDIR=%Qt5_Dir%
set QTDIR=%Qt6_Dir%
call scripts\win32\generate_sln.bat
MSBuild.exe Lightpack.sln /p:Configuration=Release
- name: Prepare Installer
Expand All @@ -170,7 +165,7 @@ jobs:
- name: Build Installer
shell: cmd
run: |
"C:/Program Files (x86)/Inno Setup 6/ISCC.exe" script.iss
"C:/Program Files (x86)/Inno Setup 6/ISCC.exe" script_qt6.iss
working-directory: ./Software/dist_windows
- name: Check Package
shell: bash
Expand Down Expand Up @@ -237,16 +232,12 @@ jobs:
run: |
export PATH=$QTDIR/bin:$PATH
qmake -r
# post-12.4 xcode workaround
# clang confuses VERSION file with <version> header and breaks
mv VERSION VERSION.bak
make
mv VERSION.bak VERSION
macdeployqt bin/Prismatik.app -dmg
- name: Check Package
run: |
set -xe
VERSION=`cat VERSION`
VERSION=`cat RELEASE_VERSION`
PKG_PATH="Software/bin/Prismatik.dmg"
PKG_NAME="Prismatik_${VERSION}.dmg"
echo "PKG_PATH=$PKG_PATH" >> $GITHUB_ENV
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Software/dist_linux/dpkg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ qmake -r
make
cd -

VERSION=`cat ../../VERSION`
VERSION=`cat ../../RELEASE_VERSION`

arch=amd64
[ ! -z $1 ] && arch=$1
Expand Down
2 changes: 1 addition & 1 deletion Software/dist_linux/flatpak/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
kde_version=5.15
flatpak_id=de.psieg.Prismatik
destdir=tmp
VERSION=`cat ../../VERSION`
VERSION=`cat ../../RELEASE_VERSION`

set -xe

Expand Down
2 changes: 1 addition & 1 deletion Software/dist_linux/pacman/PKGBUILD.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _pkgdir=../../package_template
_srcdir=../../..

pkgver() {
cat ${_srcdir}/VERSION
cat ${_srcdir}/RELEASE_VERSION
}

build() {
Expand Down
38 changes: 19 additions & 19 deletions Software/grab/DDuplGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ struct DDuplScreenData
DXGI_MAPPED_RECT surfaceMap;
};

DWORD WINAPI DDuplGrabberThreadProc(LPVOID arg) {
DDuplGrabber* _this = (DDuplGrabber*)arg;
DWORD errorcode;

while (true) {
if (WAIT_OBJECT_0 == (errorcode = WaitForSingleObject(_this->m_threadEvent, INFINITE))) {
switch (_this->m_threadCommand) {
case Exit:
SetEvent(_this->m_threadReturnEvent);
return 0;
case Reallocate:
_this->m_threadReallocateResult = _this->_reallocate(_this->m_threadReallocateArg);
break;
}
SetEvent(_this->m_threadReturnEvent);
}
}
}

DDuplGrabber::DDuplGrabber(QObject * parent, GrabberContext *context)
: GrabberBase(parent, context),
m_state(Uninitialized),
Expand Down Expand Up @@ -185,25 +204,6 @@ bool DDuplGrabber::recreateAdapters() {
return true;
}

DWORD WINAPI DDuplGrabberThreadProc(LPVOID arg) {
DDuplGrabber* _this = (DDuplGrabber*)arg;
DWORD errorcode;

while (true) {
if (WAIT_OBJECT_0 == (errorcode = WaitForSingleObject(_this->m_threadEvent, INFINITE))) {
switch (_this->m_threadCommand) {
case Exit:
SetEvent(_this->m_threadReturnEvent);
return 0;
case Reallocate:
_this->m_threadReallocateResult = _this->_reallocate(_this->m_threadReallocateArg);
break;
}
SetEvent(_this->m_threadReturnEvent);
}
}
}

bool DDuplGrabber::runThreadCommand(DWORD timeout) {
DWORD errorcode;
SetEvent(m_threadEvent);
Expand Down
2 changes: 2 additions & 0 deletions Software/grab/grab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ win32 {
QMAKE_CXXFLAGS += /MP
# Fix __cplusplus macro as required by Qt
QMAKE_CXXFLAGS += /Zc:__cplusplus
# As required by Qt
QMAKE_CXXFLAGS += /permissive-
# Create "fake" project dependencies of the libraries used dynamically
LIBS += -lprismatik-hooks -llibraryinjector -lprismatik-unhook

Expand Down
2 changes: 2 additions & 0 deletions Software/src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ win32 {
QMAKE_CXXFLAGS += /MP
# Fix __cplusplus macro as required by Qt
QMAKE_CXXFLAGS += /Zc:__cplusplus
# As required by Qt
QMAKE_CXXFLAGS += -permissive-
# Place *.lib and *.exp files in ../lib
QMAKE_LFLAGS += /IMPLIB:..\\lib\\$(TargetName).lib
}
Expand Down

0 comments on commit 8021e81

Please sign in to comment.