Commit a0b3a026 by Paul Thomson

Make the ICD manifest use a relative path to the library

Change-Id: I61aff0500bfeafd00a0a2b4ba8df2cb8c1f1e282 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33217 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarPaul Thomson <paulthomson@google.com>
parent 84b037e0
......@@ -2006,6 +2006,18 @@ if(BUILD_VULKAN)
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libvk_swiftshader> ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
)
# The vk_swiftshader_icd.json manifest file will point to ICD_LIBRARY_PATH.
# Set ICD_LIBRARY_PATH to be a relative path similar to "./libvk_swiftshader.so", so both files can be moved.
# A relative path is relative to the manifest file.
# Note that the library name is always "libvk_swiftshader"; we do not use the platform-specific prefix.
set(ICD_LIBRARY_PATH "libvk_swiftshader${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(WIN32)
# The path is output to a JSON file, which requires backslashes to be escaped.
set(ICD_LIBRARY_PATH ".\\${ICD_LIBRARY_PATH}")
else()
set(ICD_LIBRARY_PATH "./${ICD_LIBRARY_PATH}")
endif()
configure_file(
"${VULKAN_DIR}/vk_swiftshader_icd.json.tmpl"
"${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/vk_swiftshader_icd.json")
......
{
"file_format_version": "1.0.0",
"ICD": {
"library_path": "${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}vk_swiftshader${CMAKE_SHARED_LIBRARY_SUFFIX}",
"library_path": "${ICD_LIBRARY_PATH}",
"api_version": "1.0.5"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment