From 3b1613614227c43e624d6299dcf724113ae91e3d Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Sun, 19 Dec 2021 23:49:47 +0200 Subject: [PATCH] qt: Fix windows clang & vcpkg build --- src/qt/CMakeLists.txt | 5 +++++ src/qt/qt.c | 3 ++- src/qt/qt_main.cpp | 5 ++++- src/qt/qt_platform.cpp | 1 + vcpkg.json | 3 ++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 9e5d740db..ca30e69ce 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -107,6 +107,11 @@ add_library(ui STATIC ../qt_resources.qrc ) +if(NOT MINGW) + target_sources(plat PRIVATE ../win/win_opendir.c) + target_sources(plat PRIVATE ../nvr.c) +endif() + if (APPLE) target_sources(ui PRIVATE macos_event_filter.mm) endif() diff --git a/src/qt/qt.c b/src/qt/qt.c index 5aca045dc..e5a639081 100644 --- a/src/qt/qt.c +++ b/src/qt/qt.c @@ -2,8 +2,9 @@ * C functionality for Qt platform, where the C equivalent is not easily * implemented in Qt */ - +#ifdef __MINGW32__ #include +#endif #include #include diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index f8ffd3720..b730e40b0 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -33,10 +33,13 @@ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin) #define VC(x) const_cast(x) extern QElapsedTimer elapsed_timer; -extern int nvr_dosave; extern MainWindow* main_window; extern "C" { +#define new not_new +#include <86box/timer.h> +#include <86box/nvr.h> +#undef new extern int qt_nvr_save(void); } diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index aa4daee76..c2bb7a751 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -48,6 +48,7 @@ private: extern "C" { #ifdef Q_OS_WINDOWS +#define NOMINMAX #include #endif #include <86box/86box.h> diff --git a/vcpkg.json b/vcpkg.json index d8ec1d981..5607b5691 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -9,6 +9,7 @@ "libpng", "openal-soft", "sdl2", - "rtmidi" + "rtmidi", + "qt5" ] } \ No newline at end of file