Skip to content

Commit

Permalink
Added warning when no OpenGL driver detecter.
Browse files Browse the repository at this point in the history
Also tried fixing the windows CI, windeployqt.exe is so broken
on Windows...
  • Loading branch information
DorianBDev committed Sep 27, 2024
1 parent a049662 commit 365b285
Show file tree
Hide file tree
Showing 7 changed files with 472 additions and 371 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
cd build
cmake .. -DBUILD_TESTS=1
cmake --build . --config $BUILD_TYPE --target DegateTests
# Windeployqt is sooo broken when using vcpkg...
# ./vcpkg_installed/x64-windows/tools/Qt6/bin/windeployqt.exe ./tests/out/bin/$BUILD_TYPE
mkdir -P tests/out/bin/$BUILD_TYPE/imageformats
find . -name vcpkg_installed/x64-windows-degate/Qt6/plugins/imageformats/*.dll -exec cp {} tests/out/bin/$BUILD_TYPE/imageformats/ \;
cd tests/out/bin/$BUILD_TYPE
./DegateTests.exe
Expand Down
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@

cmake_minimum_required(VERSION 3.12.0)

#
# Custom triplets used by Degate (e.g. this allow mixing dynamic/static linking for dependencies)
#
set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_CURRENT_SOURCE_DIR}/etc/vcpkg-triplets")

#
# Use specific triplet for windows, that'll use static build for everything except qt
#
if (WIN32)
set(VCPKG_DEFAULT_TRIPLET "x64-windows-degate")
set(VCPKG_TARGET_TRIPLET "x64-windows-degate" CACHE STRING "target triplet" FORCE)
endif()

#
# Use vcpkg
#
Expand Down Expand Up @@ -247,7 +260,7 @@ set_target_properties(Degate PROPERTIES MACOSX_BUNDLE TRUE)
install (TARGETS Degate DESTINATION out/bin)

#
# Automatic Qt deploy
# Automatic Qt deploy (doesn't deploy everything...)
#
qt_generate_deploy_app_script(
TARGET Degate
Expand Down
7 changes: 7 additions & 0 deletions etc/vcpkg-triplets/x64-windows-degate.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(VCPKG_TARGET_ARCHITECTURE x64)

set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CRT_LINKAGE dynamic)
if(PORT MATCHES "qt")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif()
11 changes: 7 additions & 4 deletions src/Core/Utils/CrashReport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
*/

#include "CrashReport.h"

#include "Core/Version.h"
#include "CrashReport.h"
#include "Globals.h"

#include <QApplication>
Expand Down Expand Up @@ -59,7 +58,8 @@ namespace degate
// Report button
report_button.setText(tr("Report"));
QObject::connect(&report_button, &QPushButton::clicked, this, [=]() {
QDesktopServices::openUrl(QUrl("https://github.com/DegateCommunity/Degate/issues/new?template=bug_report.md"));
QDesktopServices::openUrl(
QUrl("https://github.com/DegateCommunity/Degate/issues/new?template=bug_report.md"));
});
buttons_layout.addWidget(&report_button);

Expand Down Expand Up @@ -108,7 +108,8 @@ namespace degate
.arg(QString::fromStdString(error));

std::ofstream log_file;
log_file.open(DEGATE_IN_CONFIGURATION(ERROR_FILE_NAME), std::fstream::in | std::fstream::out | std::fstream::app);
log_file.open(DEGATE_IN_CONFIGURATION(ERROR_FILE_NAME),
std::fstream::in | std::fstream::out | std::fstream::app);

if (!log_file.is_open())
return;
Expand All @@ -118,6 +119,8 @@ namespace degate
log_file.close();

degate::create_error_dialog(message.toStdString());

exit(EXIT_FAILURE);
}

void create_error_dialog(const std::string& error)
Expand Down
Loading

0 comments on commit 365b285

Please sign in to comment.