Skip to content

OpenXR layer's JSON manifest installed in wrong directory on Unix/Linux #2697

@smcv

Description

@smcv

On Unix, the JSON manifests describing the Vulkan and OpenXR layers are installed like this:

install(TARGETS VkLayer_gfxreconstruct RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if (UNIX)
    install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/VkLayer_gfxreconstruct.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/vulkan/explicit_layer.d)
    if (OPENXR_SUPPORT_ENABLED)
        install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/XrLayer_gfxreconstruct.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openxr/1/api_layers/explicit_layer.d)
    endif()

In practice this will usually mean /usr/[local/]share/vulkan/explicit_layer.d/ and /usr/[local/]share/openxr/1/api_layers/explicit_layer.d/.

/usr/[local/]share/vulkan/explicit_layer.d/ is correct for Vulkan, the Vulkan loader does look there.

But /usr/[local/]share/openxr/1/api_layers/explicit_layer.d/ is the wrong subdirectory name for OpenXR: according to https://registry.khronos.org/OpenXR/specs/1.1/loader.html#linux-manifest-search-paths it should just be explicit.d. The result is that spec-compliant loaders won't find this layer.

Suggested fix (untested):

-        install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/XrLayer_gfxreconstruct.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openxr/1/api_layers/explicit_layer.d)
+        install(FILES $<TARGET_FILE_DIR:VkLayer_gfxreconstruct>/staging-json/XrLayer_gfxreconstruct.json DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openxr/1/api_layers/explicit.d)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions