-
Notifications
You must be signed in to change notification settings - Fork 952
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
Add support to build Xvnc with meson #1729
base: master
Are you sure you want to change the base?
Conversation
Since xorg-xserver version 20, it is possible to build the xserver with meson. This updates the patches of xserver120 and xserver21.1.1 to build Xvnc with meson. Add the required meson.build on unix/xserver/hw/vnc too. This is a first step to build tigervnc with meson.
Thanks for your contribution. This could be interesting as autoconf is on the way out. But, if I'm reading things correctly, the latest release of the Xorg server still has autoconf. So it would be the next release which would require meson? I'm cautious about putting an extra burden on developers to update two build systems if we don't have to. At least not yet. Was this PR for future proofing, or do you have a requirement to use meson for Xorg already? |
+add_global_arguments('-fvisibility=hidden', language : ['c', 'cpp']) | ||
|
||
-add_global_link_arguments('-fvisibility=hidden', language : 'c') | ||
+add_global_link_arguments('-fvisibility=hidden', language : ['c', 'cpp']) |
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.
These patches are a bit annoying to maintain, so we ideally want to keep them as small as possible. Would it be possible to move these things to our meson file instead?
Basically, tell meson to "copy the global arguments from 'c' to 'cpp'"?
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.
This is the way of copying the cflags arguments from 'c' to 'cpp': using the add_global_link_arguments
.
This function can only be called before any meson target (i.e. executable, library) is declared, this is at the root meson.build file. At the hw/vnc/meson.build specific cflags can be added for each target.
The other option is to drop these changes on the patches and manually hardcode the cflags on hw/vnc/meson.build for each target (i.e. Xvnc, libvnc...) which might not be in sync with the cflags a new xserver version uses.
declare_dependency( | ||
dependencies: cpp.find_library('network', dirs: join_paths(tigervnc_builddir, 'common/network'))), | ||
declare_dependency( | ||
dependencies: cpp.find_library('unixcommon', dirs: join_paths(tigervnc_builddir, 'unix/common'))), |
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'm afraid I'm unfamiliar with meson. Will this still use our .la
files? Or do we need to come up with some new glue for meson?
It is important that it not only finds the .a
files, but also includes any dependent libraries. Possibly also cflags, but I'm unsure how well that even works currently.
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.
Hmm, I don't think meson is capable of handle .la files.
This first attempt manually adds the dependencies, as you can see (e.g. dependency('zlib')
).
Now that I see, this only works on my build setup. A workaround could be to do the dynamic library selection to build the common libs at hw/vnc/meson.build.
If the common libs were built with meson too, the library dependencies could be known.
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.
That duplication is not something we'll reasonably be able to maintain.
Moving everything from CMake to meson seems overkill. So we want to add some glue, like we have right now between CMake and libtool.
Please have a look at CMakeMacroLibtoolFile.cmake
and see how we can do something similar for meson. I.e. automatically generate dependency information in a format meson can consume.
No, I don't have any requirement to use meson. |
Since xorg-xserver version 20, it is possible to build the xserver with meson.
This updates the patches of xserver120 and xserver21.1.1 to build Xvnc with meson. Add the required meson.build on unix/xserver/hw/vnc too.
This is a first step to build tigervnc with meson.