Skip to content
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

qt/6: Use libglvnd on FreeBSD and Linux #23279

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions recipes/qt/6.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ def validate(self):

if self.options.get_safe("with_x11", False) and not self.dependencies.direct_host["xkbcommon"].options.with_x11:
raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must be enabled when the 'with_x11' option is enabled")
if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland:
raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled")

if cross_building(self):
raise ConanInvalidConfiguration("cross compiling qt 6 is not yet supported. Contributions are welcome")
Expand All @@ -307,6 +305,11 @@ def validate(self):
if self.options.get_safe("qtspeech") and not self.options.qtdeclarative:
raise ConanInvalidConfiguration("qtspeech requires qtdeclarative, cf QTBUG-108381")

if self.settings.os in ["Linux", "FreeBSD"] and self.options.get_safe("with_egl") and not self.dependencies.direct_host["libglvnd"].options.egl:
raise ConanInvalidConfiguration("The 'egl' option for the 'libglvnd' package must be enabled when the 'with_egl' option is enabled")
if self.settings.os in ["Linux", "FreeBSD"] and self.options.get_safe("opengl", "no") != "no" and not self.dependencies.direct_host["libglvnd"].options.glx:
raise ConanInvalidConfiguration("The 'glx' option for the 'libglvnd' package must be enabled when the 'opengl' option is enabled")

def layout(self):
cmake_layout(self, src_folder="src")

Expand Down Expand Up @@ -356,10 +359,12 @@ def requirements(self):
self.requires("xkbcommon/1.5.0")
if self.options.get_safe("with_x11", False):
self.requires("xorg/system")
if self.options.get_safe("with_egl"):
if self.options.get_safe("with_egl") and self.settings.os not in ["FreeBSD", "Linux"]:
self.requires("egl/system")
if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no":
if self.settings.os not in ["FreeBSD", "Linux", "Windows"] and self.options.get_safe("opengl", "no") != "no":
self.requires("opengl/system")
if self.settings.os in ["FreeBSD", "Linux"] and (self.options.get_safe("with_egl") or self.options.get_safe("opengl", "no") != "no"):
self.requires("libglvnd/1.7.0")
if self.options.with_zstd:
self.requires("zstd/1.5.5")
if self.options.qtwayland:
Expand Down Expand Up @@ -1054,10 +1059,16 @@ def _create_plugin(pluginname, libname, plugintype, requires):
gui_reqs.append("xkbcommon::xkbcommon")
if self.options.get_safe("with_x11", False):
gui_reqs.append("xorg::xorg")
if self.options.get_safe("with_egl"):
if self.options.get_safe("with_egl"):
if self.settings.os in ["Linux", "FreeBSD"]:
gui_reqs.append("libglvnd::egl")
else:
gui_reqs.append("egl::egl")
if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no":
gui_reqs.append("opengl::opengl")
if self.settings.os in ["FreeBSD", "Linux"]:
gui_reqs.append("libglvnd::gl")
else:
gui_reqs.append("opengl::opengl")
if self.options.get_safe("with_vulkan", False):
gui_reqs.append("vulkan-loader::vulkan-loader")
if is_apple_os(self):
Expand Down
Loading