Skip to content

Commit

Permalink
Attempt to fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadoum committed Oct 24, 2023
1 parent 3821bf2 commit 8ddabbf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 23 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build-qt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ jobs:
- name: Set-up Qt for cross-compilation
run:
cp -r $Qt5_DIR/lib/* $HOME/ldc2-1.33.0-windows-x64/lib
ln ldc2-1.33.0-windows-x64/lib/msvcrt.lib ldc2-1.33.0-windows-x64/lib/MSVCRT.lib

- name: Write version file
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d
Expand All @@ -290,12 +291,13 @@ jobs:

- name: Rename
run: |
mv "${{github.workspace}}/bin/sideloader.exe" "${{github.workspace}}/bin/sideloader-windows-x86_64.exe"
mv "${{github.workspace}}/bin/sideloader.pdb" "${{github.workspace}}/bin/sideloader-windows-x86_64.pdb"
mkdir "${{github.workspace}}/bin/platforms"
cp $Qt5_DIR/plugins/platforms/qwindows.dll "${{github.workspace}}/bin/platforms"
cp $Qt5_DIR/bin/Qt5Core.dll $Qt5_DIR/bin/Qt5Gui.dll $Qt5_DIR/bin/Qt5Widgets.dll "${{github.workspace}}/bin"
zip -r sideloader-windows.zip bin/*
- uses: actions/upload-artifact@v3
with:
name: sideloader-windows-x86_64
path: |
${{github.workspace}}/bin/sideloader-windows-x86_64.exe
${{github.workspace}}/bin/sideloader-windows-x86_64.pdb
${{github.workspace}}/sideloader-windows.zip
4 changes: 2 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
],

"libs-windows": [
"ucrtbase",
"msvcrt120",
"vcruntime140",
"Qt5Bootstrap",
"Qt5Core",
"Qt5Gui",
"Qt5Widgets"
Expand Down
19 changes: 4 additions & 15 deletions qt/frontend.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,10 @@ shared class QtFrontend: Frontend {
version (Windows) {
configureSegfaultHandler();
}
try {
scope qtApp = new QApplication(Runtime.cArgs.argc, Runtime.cArgs.argv);
// version (OSX) {
// QDir plugInDir = QCoreApplication.applicationDirPath();
// plugInDir.cdUp();
// plugInDir.cd(QString("plugins"));
// QCoreApplication.setLibraryPaths(QStringList(plugInDir.absolutePath()));
// }
auto w = new MainWindow();
w.show();
return qtApp.exec();
} catch (Exception ex) {
getLogger().errorF!"Unhandled exception: %s"(ex);
throw ex;
}
scope qtApp = new QApplication(Runtime.cArgs.argc, Runtime.cArgs.argv);
auto w = new MainWindow();
w.show();
return qtApp.exec();
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ int main(string[] args) {

signal(SIGSEGV, cast(Parameters!signal[1]) &SIGSEGV_trace);

frontend = native_frontend.makeFrontend();
log.info(versionStr);
frontend = native_frontend.makeFrontend();
log.infoF!"Configuration path: %s"(frontend.configurationPath());
if (!file.exists(frontend.configurationPath)) {
file.mkdirRecurse(frontend.configurationPath);
Expand Down
1 change: 0 additions & 1 deletion windows/common/logging.d
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class OutputDebugStringLogHandler : LogHandler {
// if (msg.level.value >= Levels.ERROR.value) {
// OutputDebugStringA(logStr.toStringz());
// } else {
writeln(logStr);
OutputDebugStringA(logStr.toStringz());
// }
}
Expand Down

0 comments on commit 8ddabbf

Please sign in to comment.