Sfoglia il codice sorgente

Wayland: Fix build config with `so_wrap` disabled

We should only include the vendored headers for Wayland and libdecor-0 when
we use `so_wrap`, i.e. when we *don't* build against system libraries.

The libdecor-0 pkg-config file includes the `libdecor-0/` prefix already,
so its header should be included without it, and likewise in our so wrappers.
Fixes #102671.
Rémi Verschelde 8 mesi fa
parent
commit
19a30bb723

+ 4 - 1
platform/linuxbsd/detect.py

@@ -455,11 +455,14 @@ def configure(env: "SConsEnvironment"):
                 print_error("Wayland EGL library not found. Aborting.")
                 sys.exit(255)
             env.ParseConfig("pkg-config wayland-egl --cflags --libs")
+        else:
+            env.Prepend(CPPPATH=["#thirdparty/linuxbsd_headers/wayland/"])
+            if env["libdecor"]:
+                env.Prepend(CPPPATH=["#thirdparty/linuxbsd_headers/libdecor-0/"])
 
         if env["libdecor"]:
             env.Append(CPPDEFINES=["LIBDECOR_ENABLED"])
 
-        env.Prepend(CPPPATH=["#platform/linuxbsd", "#thirdparty/linuxbsd_headers/wayland/"])
         env.Append(CPPDEFINES=["WAYLAND_ENABLED"])
         env.Append(LIBS=["rt"])  # Needed by glibc, used by _allocate_shm_file
 

+ 2 - 2
platform/linuxbsd/wayland/dynwrappers/libdecor-so_wrap.c

@@ -1,7 +1,7 @@
 // This file is generated. Do not edit!
 // see https://github.com/hpvb/dynload-wrapper for details
 // generated by ./generate-wrapper.py 0.3 on 2022-12-12 10:55:19
-// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor-0/libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
+// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
 //
 // EDIT: This has been handpatched to properly report the pointer type of the window_state argument of libdecor_configuration_get_window_state.
 #include <stdint.h>
@@ -45,7 +45,7 @@
 #define libdecor_state_free libdecor_state_free_dylibloader_orig_libdecor
 #define libdecor_configuration_get_content_size libdecor_configuration_get_content_size_dylibloader_orig_libdecor
 #define libdecor_configuration_get_window_state libdecor_configuration_get_window_state_dylibloader_orig_libdecor
-#include <libdecor-0/libdecor.h>
+#include <libdecor.h>
 #undef libdecor_unref
 #undef libdecor_new
 #undef libdecor_get_fd

+ 2 - 2
platform/linuxbsd/wayland/dynwrappers/libdecor-so_wrap.h

@@ -3,7 +3,7 @@
 // This file is generated. Do not edit!
 // see https://github.com/hpvb/dynload-wrapper for details
 // generated by ./generate-wrapper.py 0.3 on 2022-12-12 10:55:19
-// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor-0/libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
+// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
 //
 // EDIT: This has been handpatched to properly report the pointer type of the window_state argument of libdecor_configuration_get_window_state.
 #include <stdint.h>
@@ -47,7 +47,7 @@
 #define libdecor_state_free libdecor_state_free_dylibloader_orig_libdecor
 #define libdecor_configuration_get_content_size libdecor_configuration_get_content_size_dylibloader_orig_libdecor
 #define libdecor_configuration_get_window_state libdecor_configuration_get_window_state_dylibloader_orig_libdecor
-#include <libdecor-0/libdecor.h>
+#include <libdecor.h>
 #undef libdecor_unref
 #undef libdecor_new
 #undef libdecor_get_fd

+ 1 - 1
platform/linuxbsd/wayland/wayland_thread.h

@@ -78,7 +78,7 @@
 #ifdef SOWRAP_ENABLED
 #include "dynwrappers/libdecor-so_wrap.h"
 #else
-#include <libdecor-0/libdecor.h>
+#include <libdecor.h>
 #endif // SOWRAP_ENABLED
 #endif // LIBDECOR_ENABLED