Commit 66bd15555cd83d2b1f47c7b390f444495a6b64a7

Frank Praznik 2022-11-23T23:11:25

wayland: Fix build when not using the shared Wayland libraries Explicitly include the Wayland protocol headers when statically linking against the Wayland libraries or older system headers might be used instead of the local versions. (cherry picked from commit 836eb224428aca3bdab2a6bf56d347262e475b15)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/video/wayland/SDL_waylanddyn.h b/src/video/wayland/SDL_waylanddyn.h
index 12341e1..887c51d 100644
--- a/src/video/wayland/SDL_waylanddyn.h
+++ b/src/video/wayland/SDL_waylanddyn.h
@@ -166,6 +166,13 @@ void SDL_WAYLAND_UnloadSymbols(void);
 
 #else /* SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */
 
+/*
+ * These must be included before libdecor.h, otherwise the libdecor header
+ * pulls in the system Wayland protocol headers instead of ours.
+ */
+#include "wayland-client-protocol.h"
+#include "wayland-egl.h"
+
 #ifdef HAVE_LIBDECOR_H
 #include <libdecor.h>
 #endif