-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Linux] Make SO wrapper usage optional. #73359
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good!
Thanks for working on this PR! It works fine on OpenBSD and I can see Godot being linked to libX11 & co. I had to do a small change on top to fix the compilation: --- platform/linuxbsd/x11/display_server_x11.cpp
+++ platform/linuxbsd/x11/display_server_x11.cpp
@@ -28,8 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
-#include "display_server_x11.h"
-
#ifdef X11_ENABLED
#include "core/config/project_settings.h"
@@ -41,6 +39,8 @@
#include "main/main.h"
#include "scene/resources/texture.h"
+#include "display_server_x11.h"
+
#if defined(VULKAN_ENABLED)
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#endif otherwise the compilation would fail with various errors (see below.) To be fair I'm building Godot with a few more patches on top (needed for thirdparty/ stuff mostly) so it may be due to that, although I doubt.
|
b00ab62
to
529b61e
Compare
@@ -41,6 +39,8 @@ | |||
#include "main/main.h" | |||
#include "scene/resources/texture.h" | |||
|
|||
#include "display_server_x11.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why that move is needed, sounds to me like we have some includes above that need to go to the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer we fix this properly, as someone might move this back up following our includes policy and trigger the same error.
I haven't tested but at least this might help:
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 4d3eecd4fc..896b7b95eb 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
+#include "display_server_x11.h"
+
#ifdef X11_ENABLED
#include "core/config/project_settings.h"
@@ -39,8 +41,6 @@
#include "main/main.h"
#include "scene/resources/texture.h"
-#include "display_server_x11.h"
-
#if defined(VULKAN_ENABLED)
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#endif
diff --git a/platform/linuxbsd/x11/display_server_x11.h b/platform/linuxbsd/x11/display_server_x11.h
index 1eba2f8a4c..dbe8a0ce2b 100644
--- a/platform/linuxbsd/x11/display_server_x11.h
+++ b/platform/linuxbsd/x11/display_server_x11.h
@@ -36,6 +36,8 @@
#include "servers/display_server.h"
#include "core/input/input.h"
+#include "core/os/mutex.h"
+#include "core/os/thread.h"
#include "core/templates/local_vector.h"
#include "drivers/alsa/audio_driver_alsa.h"
#include "drivers/alsamidi/midi_driver_alsamidi.h"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW it still builds fine for me with this applied, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed working fine for a build with as many libraries unbundled (linked against system libs) as possible.
Thanks! |
Adds
use_sowrap
build option to disable SO wrappers and link system libraries directly.See #69449 (comment)