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
@@ -83,7 +83,9 @@
       m_normal_state(GHOST_kWindowStateNormal),
       m_user32(::LoadLibrary("user32.dll")),
       m_parentWindowHwnd(parentwindow ? parentwindow->m_hWnd : HWND_DESKTOP),
+#ifdef _MSC_VER
       m_directManipulationHelper(nullptr),
+#endif
       m_debug_context(is_debug)
 {
   DWORD style = parentwindow ?
@@ -217,7 +219,7 @@
   /* Allow the showing of a progress bar on the taskbar. */
   CoCreateInstance(
       CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (LPVOID *)&m_Bar);
-
+#ifdef _MSC_VER
   /* Initialize Direct Manipulation. */
   m_directManipulationHelper = GHOST_DirectManipulationHelper::create(m_hWnd, getDPIHint());
 }
@@ -253,6 +255,7 @@
   }
 
   return m_directManipulationHelper->getTrackpadInfo();
+#endif
 }
 
 GHOST_WindowWin32::~GHOST_WindowWin32()
@@ -306,9 +309,10 @@
     ::DestroyWindow(m_hWnd);
     m_hWnd = 0;
   }
-
+#ifdef _MSC_VER
   delete m_directManipulationHelper;
   m_directManipulationHelper = nullptr;
+#endif
 }
 
 void GHOST_WindowWin32::adjustWindowRectForClosestMonitor(LPRECT win_rect,
@@ -1116,14 +1120,14 @@
     DwmSetWindowAttribute(this->m_hWnd, 20, &DarkMode, sizeof(DarkMode));
   }
 }
-
+#ifdef _MSC_VER
 void GHOST_WindowWin32::updateDPI()
 {
   if (m_directManipulationHelper) {
     m_directManipulationHelper->setDPI(getDPIHint());
   }
 }
-
+#endif
 uint16_t GHOST_WindowWin32::getDPIHint()
 {
   if (m_user32) {
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
@@ -290,7 +292,9 @@
    */
   GHOST_TabletData getTabletData();
 
+#ifdef _MSC_VER
   void updateDPI();
+#endif
 
   uint16_t getDPIHint() override;
 
@@ -314,6 +318,7 @@
   void endIME();
 #endif /* WITH_INPUT_IME */
 
+#ifdef _MSC_VER
   /*
    * Drive DirectManipulation context.
    */
@@ -327,6 +332,7 @@
 
   GHOST_TTrackpadInfo getTrackpadInfo();
 
+#endif
  private:
   /**
    * \param type: The type of rendering context create.
@@ -413,7 +419,9 @@
 
   HWND m_parentWindowHwnd;
 
+#ifdef _MSC_VER
   GHOST_DirectManipulationHelper *m_directManipulationHelper;
+#endif
 
 #ifdef WITH_INPUT_IME
   /** Handle input method editors event */
