From b65a0be3d68610f87b062787b6606ef4609641cd Mon Sep 17 00:00:00 2001 From: Tom Sutcliffe Date: Sun, 11 Apr 2021 15:53:22 +0100 Subject: [PATCH] Fix/silence mac build warnings As per Xcode 12.4 you can at least do a warning-free incremental build with these changes. There are still plenty of warnings in a full build (mostly from thirdparty components) but with these changes you can at least develop on mac and see if/when you've added any new warnings when doing incremental builds. --- src/CMakeLists.txt | 1 + src/platform/guimac.mm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ec39939..7bc5a7c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -117,6 +117,7 @@ if(WIN32) ${SPACEWARE_LIBRARIES}) elseif(APPLE) add_compile_options( + -DGL_SILENCE_DEPRECATION -fobjc-arc) list(APPEND platform_SOURCES diff --git a/src/platform/guimac.mm b/src/platform/guimac.mm index b2b07a8..f9a95fc 100644 --- a/src/platform/guimac.mm +++ b/src/platform/guimac.mm @@ -286,7 +286,8 @@ public: } void PopUp() override { - [NSMenu popUpContextMenu:nsMenu withEvent:[NSApp currentEvent] forView:nil]; + NSEvent* event = [NSApp currentEvent]; + [NSMenu popUpContextMenu:nsMenu withEvent:event forView:event.window.contentView]; } void Clear() override {