Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows workflow #39

Merged
merged 11 commits into from
Mar 4, 2024
Prev Previous commit
Next Next commit
Force dependency on Qt OpenGL Widgets on Windows
  • Loading branch information
adazem009 committed Mar 2, 2024
commit 30b2edea4a806ecb7a47e059b765767993502c58
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(SCRATCHCPP_PLAYER_BUILD_UNIT_TESTS "Build unit tests" ON)

find_package(Qt6 6.6 COMPONENTS Quick QuickControls2 Widgets REQUIRED)
set(QT_LIBS Qt6::Quick Qt6::QuickControls2 Qt6::Widgets)
find_package(Qt6 6.6 COMPONENTS Quick QuickControls2 Widgets OpenGLWidgets REQUIRED)
set(QT_LIBS Qt6::Quick Qt6::QuickControls2 Qt6::Widgets Qt6::OpenGLWidgets)

if (SCRATCHCPP_PLAYER_BUILD_UNIT_TESTS)
set(GTEST_DIR thirdparty/googletest)
Expand Down
8 changes: 8 additions & 0 deletions src/app/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include "modularity/ioc.h"
#include "ui/internal/uiengine.h"

#ifdef Q_OS_WINDOWS
#include <QOpenGLWidget>
#endif

using namespace scratchcpp;
using namespace scratchcpp::modularity;

Expand Down Expand Up @@ -82,6 +86,10 @@ int App::run(int argc, char **argv)

ui::UiEngine::instance()->setQmlEngine(&engine);

#ifdef Q_OS_WINDOWS
QOpenGLWidget glWidget; // force dependency on OpenGL widgets
#endif

// Run the event loop
int exitCode = app.exec();

Expand Down
Loading