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

Fix locating moltenvk headers when with_vulkan=True #24903

Merged
merged 2 commits into from
Aug 13, 2024
Merged
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
18 changes: 14 additions & 4 deletions recipes/qt/6.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

def _debug_output(self, message):
if Version(conan_version) >= "2":
self.output.debug(message)

Check failure on line 204 in recipes/qt/6.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Instance of 'ScopedOutput' has no 'debug' member. Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md

def configure(self):
if not self.options.gui:
Expand Down Expand Up @@ -304,9 +304,6 @@
if Version(self.version) >= "6.6.1" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "13.1":
raise ConanInvalidConfiguration("apple-clang >= 13.1 is required by qt >= 6.6.1 cf QTBUG-119490")

if self.settings.os == "Macos" and self.dependencies["double-conversion"].options.shared:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This restriction is artificial and not related to Qt itself, but rather Conan or Conan Center - lifting it. Have managed to reproduce the original problems, if issues are reported will propose a more robust fix (otherwise, this is not currently causing issues on CI).

raise ConanInvalidConfiguration("Test recipe fails because of Macos' SIP. Contributions are welcome.")

if self.options.get_safe("qtwebengine"):
if not self.options.shared:
raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported")
Expand Down Expand Up @@ -366,7 +363,12 @@
if self.options.with_pcre2:
self.requires("pcre2/10.42")
if self.options.get_safe("with_vulkan"):
self.requires("vulkan-loader/1.3.268.0")
# Note: the versions of vulkan-loader and moltenvk
# must be exactly part of the same Vulkan SDK version
# do not update either without checking both
# require exactly the same version of vulkan-headers
self.requires("vulkan-loader/1.3.239.0")
self.requires("vulkan-headers/1.3.239.0", transitive_headers=True)
if is_apple_os(self):
self.requires("moltenvk/1.2.2")
if self.options.with_glib:
Expand Down Expand Up @@ -721,6 +723,13 @@
"qt_auto_detect_vcpkg()",
"# qt_auto_detect_vcpkg()")

# Handle locating moltenvk headers when vulkan is enabled on macOS
replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "FindWrapVulkanHeaders.cmake"),
"if(APPLE)", "if(APPLE)\n"
" find_package(moltenvk REQUIRED QUIET)\n"
" target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE ${moltenvk_INCLUDE_DIR})"
)

def _xplatform(self):
if self.settings.os == "Linux":
if self.settings.compiler == "gcc":
Expand Down Expand Up @@ -879,7 +888,7 @@
filecontents += f"set(QT_VERSION_MINOR {ver.minor})\n"
filecontents += f"set(QT_VERSION_PATCH {ver.patch})\n"
if self.settings.os == "Macos":
filecontents += f'set(__qt_internal_cmake_apple_support_files_path "${{CMAKE_CURRENT_LIST_DIR}}/../../../res/macos")\n'

Check warning on line 891 in recipes/qt/6.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Using an f-string that does not have any interpolated variables
targets = ["moc", "rcc", "tracegen", "cmake_automoc_parser", "qlalr", "qmake"]
if self.options.with_dbus:
targets.extend(["qdbuscpp2xml", "qdbusxml2cpp"])
Expand Down Expand Up @@ -1118,6 +1127,7 @@
gui_reqs.append("opengl::opengl")
if self.options.get_safe("with_vulkan", False):
gui_reqs.append("vulkan-loader::vulkan-loader")
gui_reqs.append("vulkan-headers::vulkan-headers")
if is_apple_os(self):
gui_reqs.append("moltenvk::moltenvk")
if self.options.with_harfbuzz:
Expand Down
Loading