From 033139677b7399050a4de3566f76fcff0dc5cead Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Wed, 27 Jul 2022 06:50:25 +0200 Subject: [PATCH] Other: fix for windows build and default to MSVC toolchain on Windows. --- internal/frontend/bridge-gui/CMakeLists.txt | 2 +- internal/frontend/bridge-gui/EventStreamWorker.h | 3 --- internal/frontend/bridge-gui/Pch.h | 7 +++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/frontend/bridge-gui/CMakeLists.txt b/internal/frontend/bridge-gui/CMakeLists.txt index 0513a563..f1c3ae3a 100644 --- a/internal/frontend/bridge-gui/CMakeLists.txt +++ b/internal/frontend/bridge-gui/CMakeLists.txt @@ -42,7 +42,7 @@ if (APPLE) endif() if (WIN32) - set(VCPKG_TARGET_TRIPLET x64-mingw-static) + set(VCPKG_TARGET_TRIPLET x64-windows) endif() set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "toolchain") diff --git a/internal/frontend/bridge-gui/EventStreamWorker.h b/internal/frontend/bridge-gui/EventStreamWorker.h index cd3e4939..293dceb1 100644 --- a/internal/frontend/bridge-gui/EventStreamWorker.h +++ b/internal/frontend/bridge-gui/EventStreamWorker.h @@ -42,10 +42,7 @@ public slots: void run() override; ///< Run the reader. signals: -#pragma clang diagnostic push -#pragma ide diagnostic ignored "NotImplementedFunctions" void eventReceived(QString eventString); ///< signal for events. -#pragma clang diagnostic pop }; diff --git a/internal/frontend/bridge-gui/Pch.h b/internal/frontend/bridge-gui/Pch.h index d18a9fb3..a6f1bfcc 100644 --- a/internal/frontend/bridge-gui/Pch.h +++ b/internal/frontend/bridge-gui/Pch.h @@ -27,4 +27,11 @@ #include +#if defined(Q_OS_WIN32) && defined(ERROR) +// The folks at Microsoft have decided that it was OK to `#define ERROR 0` in wingdi.h. It is not OK, because +// any occurrence of ERROR, even scoped, will be substituted. For instance Log::Level::ERROR (case imposed by gRPC). +#undef ERROR +#endif + + #endif // BRIDGE_GUI_PCH_H