diff -Naur blender-4.5.2/intern/ghost/CMakeLists.txt blender-4.5.2-patched/intern/ghost/CMakeLists.txt
--- blender-4.5.2/intern/ghost/CMakeLists.txt	2025-08-26 12:34:17.454538500 +0300
+++ blender-4.5.2-patched/intern/ghost/CMakeLists.txt	2025-08-26 12:34:58.448617700 +0300
@@ -464,7 +464,6 @@
     intern/GHOST_ContextD3D.cc
     intern/GHOST_DropTargetWin32.cc
     intern/GHOST_SystemWin32.cc
-    intern/GHOST_TrackpadWin32.cc
     intern/GHOST_WindowWin32.cc
     intern/GHOST_Wintab.cc
 
@@ -472,10 +471,15 @@
     intern/GHOST_DropTargetWin32.hh
     intern/GHOST_SystemWin32.hh
     intern/GHOST_TaskbarWin32.hh
-    intern/GHOST_TrackpadWin32.hh
     intern/GHOST_WindowWin32.hh
     intern/GHOST_Wintab.hh
   )
+  if(MSVC)
+    list(APPEND SRC
+      intern/GHOST_TrackpadWin32.cpp
+      intern/GHOST_TrackpadWin32.h
+    )
+  endif()
   list(APPEND LIB comctl32 shcore dwmapi)
 
   list(APPEND SRC
diff -Naur blender-4.5.2/intern/ghost/intern/GHOST_SystemWin32.cc blender-4.5.2-patched/intern/ghost/intern/GHOST_SystemWin32.cc
--- blender-4.5.2/intern/ghost/intern/GHOST_SystemWin32.cc	2025-08-26 12:34:17.380438500 +0300
+++ blender-4.5.2-patched/intern/ghost/intern/GHOST_SystemWin32.cc	2025-08-26 12:34:58.453614600 +0300
@@ -441,9 +441,9 @@
     if (timerMgr->fireTimers(getMilliSeconds())) {
       hasEventHandled = true;
     }
-
+#ifdef _MSC_VER
     driveTrackpad();
-
+#endif
     /* Process all the events waiting for us. */
     while (::PeekMessageW(&msg, nullptr, 0, 0, PM_REMOVE) != 0) {
       /* #TranslateMessage doesn't alter the message, and doesn't change our raw keyboard data.
@@ -452,9 +452,9 @@
       ::DispatchMessageW(&msg);
       hasEventHandled = true;
     }
-
+#ifdef _MSC_VER
     processTrackpad();
-
+#endif
     /* `PeekMessage` above is allowed to dispatch messages to the `wndproc` without us
      * noticing, so we need to check the event manager here to see if there are
      * events waiting in the queue. */
@@ -1543,7 +1543,7 @@
   return eventSent;
 }
 #endif /* WITH_INPUT_NDOF */
-
+#ifdef _MSC_VER
 void GHOST_SystemWin32::driveTrackpad()
 {
   GHOST_WindowWin32 *active_window = static_cast<GHOST_WindowWin32 *>(
@@ -1589,7 +1589,7 @@
                                               false));
   }
 }
-
+#endif
 LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, uint msg, WPARAM wParam, LPARAM lParam)
 {
   GHOST_Event *event = nullptr;
@@ -2220,8 +2220,9 @@
                        suggestedWindowRect->right - suggestedWindowRect->left,
                        suggestedWindowRect->bottom - suggestedWindowRect->top,
                        SWP_NOZORDER | SWP_NOACTIVATE);
-
+#ifdef _MSC_VER
           window->updateDPI();
+#endif
           break;
         }
         case WM_DISPLAYCHANGE: {
@@ -2330,6 +2331,7 @@
            * In GHOST, we let DefWindowProc call the timer callback. */
           break;
         }
+#ifdef _MSC_VER
         case DM_POINTERHITTEST: {
           /* The DM_POINTERHITTEST message is sent to a window, when pointer input is first
            * detected, in order to determine the most probable input target for Direct
@@ -2339,6 +2341,7 @@
           }
           break;
         }
+#endif
       }
     }
     else {
diff -Naur blender-4.5.2/intern/ghost/intern/GHOST_SystemWin32.hh blender-4.5.2-patched/intern/ghost/intern/GHOST_SystemWin32.hh
--- blender-4.5.2/intern/ghost/intern/GHOST_SystemWin32.hh	2025-08-26 12:34:17.400434700 +0300
+++ blender-4.5.2-patched/intern/ghost/intern/GHOST_SystemWin32.hh	2025-08-26 12:34:58.458614300 +0300
@@ -445,7 +445,7 @@
    */
   bool processNDOF(RAWINPUT const &raw);
 #endif
-
+#ifdef _MSC_VER
   /**
    * Drives Direct Manipulation update.
    */
@@ -455,7 +455,7 @@
    * Creates trackpad events for the active window.
    */
   void processTrackpad();
-
+#endif
   /**
    * Check current key layout for AltGr
    */
diff -Naur blender-4.5.2/intern/ghost/intern/GHOST_TrackpadWin32.cc blender-4.5.2-patched/intern/ghost/intern/GHOST_TrackpadWin32.cc
--- blender-4.5.2/intern/ghost/intern/GHOST_TrackpadWin32.cc	2025-08-26 12:34:17.402433900 +0300
+++ blender-4.5.2-patched/intern/ghost/intern/GHOST_TrackpadWin32.cc	2025-08-26 12:34:58.461613300 +0300
@@ -9,7 +9,9 @@
 #include <cmath>
 
 #include "GHOST_Debug.hh"
+#ifdef _MSC_VER
 #include "GHOST_TrackpadWin32.hh"
+#endif
 
 GHOST_DirectManipulationHelper::GHOST_DirectManipulationHelper(
     HWND hWnd,
diff -Naur blender-4.5.2/intern/ghost/intern/GHOST_WindowWin32.cc blender-4.5.2-patched/intern/ghost/intern/GHOST_WindowWin32.cc
--- blender-4.5.2/intern/ghost/intern/GHOST_WindowWin32.cc	2025-08-26 12:34:17.369439100 +0300
+++ blender-4.5.2-patched/intern/ghost/intern/GHOST_WindowWin32.cc	2025-08-26 12:34:58.465645200 +0300
@@ -81,8 +81,10 @@
       last_pointer_tablet_data_(GHOST_TABLET_DATA_NONE),
       normal_state_(GHOST_kWindowStateNormal),
       user32_(::LoadLibrary("user32.dll")),
-      parent_window_hwnd_(parent_window ? parent_window->h_wnd_ : HWND_DESKTOP),
+      parent_window_hwnd_(parent_window ? parent_window->h_wnd_ : HWND_DESKTOP)
+#ifdef _MSC_VER
       direct_manipulation_helper_(nullptr)
+#endif
 {
   DWORD style = parent_window ?
                     WS_POPUPWINDOW | WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX :
@@ -216,13 +216,16 @@
   CoCreateInstance(
       CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID *)&bar_);
 
+#ifdef _MSC_VER
   /* Initialize Direct Manipulation. */
   direct_manipulation_helper_ = GHOST_DirectManipulationHelper::create(h_wnd_, getDPIHint());
+#endif
 
   /* Initialize HDR info. */
   updateHDRInfo();
 }
 
+#ifdef _MSC_VER
 void GHOST_WindowWin32::updateDirectManipulation()
 {
   if (!direct_manipulation_helper_) {
@@ -255,6 +258,7 @@
 
   return direct_manipulation_helper_->getTrackpadInfo();
 }
+#endif
 
 GHOST_WindowWin32::~GHOST_WindowWin32()
 {
@@ -308,8 +312,10 @@
     h_wnd_ = 0;
   }
 
+#ifdef _MSC_VER
   delete direct_manipulation_helper_;
   direct_manipulation_helper_ = nullptr;
+#endif
 }
 
 void GHOST_WindowWin32::adjustWindowRectForClosestMonitor(LPRECT win_rect,
@@ -1028,12 +1034,14 @@
   }
 }
 
+#ifdef _MSC_VER
 void GHOST_WindowWin32::updateDPI()
 {
   if (direct_manipulation_helper_) {
     direct_manipulation_helper_->setDPI(getDPIHint());
   }
 }
+#endif
 
 uint16_t GHOST_WindowWin32::getDPIHint()
 {
diff -Naur blender-4.5.2/intern/ghost/intern/GHOST_WindowWin32.hh blender-4.5.2-patched/intern/ghost/intern/GHOST_WindowWin32.hh
--- blender-4.5.2/intern/ghost/intern/GHOST_WindowWin32.hh	2025-08-26 12:34:17.438438400 +0300
+++ blender-4.5.2-patched/intern/ghost/intern/GHOST_WindowWin32.hh	2025-08-26 12:34:58.469645300 +0300
@@ -14,7 +14,9 @@
 #endif /* WIN32 */
 
 #include "GHOST_TaskbarWin32.hh"
+#ifdef _MSC_VER
 #include "GHOST_TrackpadWin32.hh"
+#endif
 #include "GHOST_Window.hh"
 #include "GHOST_Wintab.hh"
 #ifdef WITH_INPUT_IME
@@ -289,7 +291,9 @@
    */
   GHOST_TabletData getTabletData();
 
+#ifdef _MSC_VER
   void updateDPI();
+#endif
 
   uint16_t getDPIHint() override;
 
@@ -313,6 +317,7 @@
   void endIME();
 #endif /* WITH_INPUT_IME */
 
+#ifdef _MSC_VER
   /*
    * Drive DirectManipulation context.
    */
@@ -329,6 +334,7 @@
   void onPointerHitTest(WPARAM wParam);
 
   GHOST_TTrackpadInfo getTrackpadInfo();
+#endif
 
   /* Update HDR info on initialization and window changes. */
   void updateHDRInfo();
@@ -413,7 +419,9 @@
 
   HWND parent_window_hwnd_;
 
+#ifdef _MSC_VER
   GHOST_DirectManipulationHelper *direct_manipulation_helper_;
+#endif
 
 #ifdef WITH_INPUT_IME
   /** Handle input method editors event */
