Skip to content

Commit

Permalink
(#19606) [vulkan-validationlayers] Fix discovery of libVkLayer_khrono…
Browse files Browse the repository at this point in the history
…s_validation

* [vulkan-validationlayers] Fix discovery of libVkLayer_khronos_validation

* Add libdirs to the runtime lib discovery path to enable
  libVlLayer_khronos_validation.{so,dll,dylib} to be discovered
  appropriately at runtime. This package exports both a static library
  and a shared library, of which, only the static library should be
  linked against. The shared library is loaded dynamically by
  vulkan-loader, and still needs to be discoverable. Because this is not
  a shared library, these paths are not exported automatically and
  therefore are required to be explicitly set.

Closes #19605

* Remove notification of runtime_lib_discovery_path update

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>

---------

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Co-authored-by: Rubén Rincón Blanco <rubenrb@jfrog.com>
  • Loading branch information
3 people authored Dec 21, 2023
1 parent d5dc5a7 commit ee18955
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions recipes/vulkan-validationlayers/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,17 @@ def package_info(self):
manifest_subfolder = "bin" if self.settings.os == "Windows" else os.path.join("res", "vulkan", "explicit_layer.d")
vk_layer_path = os.path.join(self.package_folder, manifest_subfolder)
self.runenv_info.prepend_path("VK_LAYER_PATH", vk_layer_path)

# Update runtime discovery paths to allow libVkLayer_khronos_validation.{so,dll,dylib} to be discovered
# and loaded by vulkan-loader when the consumer executes
# This is necessary because this package exports a static lib to link against and a dynamic lib to load at runtime
runtime_lib_discovery_path = "LD_LIBRARY_PATH"
if self.settings.os == "Windows":
runtime_lib_discovery_path = "PATH"
if self.settings.os == "Macos":
runtime_lib_discovery_path = "DYLD_LIBRARY_PATH"
for libdir in [os.path.join(self.package_folder, libdir) for libdir in self.cpp_info.libdirs]:
self.runenv_info.prepend_path(runtime_lib_discovery_path, libdir)

# TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator
self.env_info.VK_LAYER_PATH.append(vk_layer_path)

0 comments on commit ee18955

Please sign in to comment.