-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
glfw: limit xorg library dependencies #23272
glfw: limit xorg library dependencies #23272
Conversation
Previously the glfw package would implicitly require linking with xorg::xorg, which includes all the libraries exposed by the xorg package. This commit explicitly declares the requirements of glfw, limiting the xorg libraries to only those needed.
The ability to link to a static Vulkan loader was removed in glfw version 3.4.
🤖 Beep Boop! This pull request is making changes to 'recipes/glfw//'. 👋 @Hopobcn you might be interested. 😉 |
recipes/glfw/all/conanfile.py
Outdated
if Version(self.version) < "3.4": | ||
if self.options.get_safe("vulkan_static"): | ||
self.cpp_info.requires.extend(["vulkan-loader::vulkan-loader"]) | ||
if self.settings.os in ["Linux", "FreeBSD"]: | ||
if self.options.get_safe("with_x11", True): | ||
self.cpp_info.requires.extend(["xorg::x11"]) | ||
if self.options.get_safe("with_wayland"): | ||
self.cpp_info.requires.extend(["wayland::wayland", "xkbcommon::xkbcommon"]) |
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.
if Version(self.version) < "3.4": | |
if self.options.get_safe("vulkan_static"): | |
self.cpp_info.requires.extend(["vulkan-loader::vulkan-loader"]) | |
if self.settings.os in ["Linux", "FreeBSD"]: | |
if self.options.get_safe("with_x11", True): | |
self.cpp_info.requires.extend(["xorg::x11"]) | |
if self.options.get_safe("with_wayland"): | |
self.cpp_info.requires.extend(["wayland::wayland", "xkbcommon::xkbcommon"]) | |
if self.options.get_safe("vulkan_static"): | |
self.cpp_info.requires.extend(["vulkan-loader::vulkan-loader"]) | |
if self.settings.os in ["Linux", "FreeBSD"]: | |
if self.options.get_safe("with_x11", True): | |
self.cpp_info.requires.extend(["xorg::x11"]) | |
if self.options.get_safe("with_wayland"): | |
self.cpp_info.requires.extend(["wayland::wayland", "xkbcommon::xkbcommon"]) |
I don't think the version check is necessary as it's already handled by the deleted options in configure()
, no?
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 think the version check is needed because even when you specify with_x11=True
or with_wayland=True
, the glfw library does not require linking with these after version 3.4, which implemented the runtime platform detection.
This comment has been minimized.
This comment has been minimized.
From version 3.4, glfw loads platform libraries at runtime, and so it is not necessary to link with these.
18ad9b7
to
c05ac9d
Compare
Conan v1 pipeline ✔️All green in build 2 (
Conan v2 pipeline ✔️
All green in build 2 (
|
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.
LGTM
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.
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.
Need to remove some redundant/conflicting logic in package_info() that was added by #25547, which got merged first.
@perseoGI Needs a follow-up PR. |
@valgur Which logic are you refering? |
The requires being added for vulkan, xorg and wayland on lines 230-251 are being duplicated by the logic added in this PR. |
Okey I see. Lines conan-center-index/recipes/glfw/all/conanfile.py Lines 230 to 251 in dc3c064
But in this PR the version control was added. Should we keep the previous lines with the version control? Could you @johningve or @valgur open a PR to fix this? |
Co-authored-by: PerseoGI <perseog@jfrog.com>
Previously the glfw package would implicitly require linking with xorg::xorg, which includes all the libraries exposed by the xorg package.
This change explicitly declares the requirements of glfw, limiting the xorg libraries to only those needed.
From version 3.4 these dependencies are no longer necessary since glew implemented runtime platform detection.
Also removes vulkan_static option in version 3.4, since it is no longer supported by glfw.
Specify library name and version: glfw/all