1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

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.
This commit is contained in:
Rémi Verschelde
2025-02-10 21:42:20 +01:00
parent 296de7da83
commit 19a30bb723
4 changed files with 9 additions and 6 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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