Commit ac736125 by Ben Clayton

CMake: Emit coverage-toolchain.txt file next to ICD json

When `SWIFTSHADER_EMIT_COVERAGE` is enabled, generate a new `coverage-toolchain.txt` text file next to the `vk_swiftshader_icd.json` file. This file contains a path to the C++ compiler toolchain used to build swiftshader, so that the regres tooling can locate the llvm tools used to parse the coverage data. Bug: b/152192800 Change-Id: I3aa718206c3262bcd05e13e854002dea8f40801f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/42889Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 063fc02c
......@@ -1339,6 +1339,19 @@ if(SWIFTSHADER_BUILD_VULKAN)
"${VULKAN_DIR}/vk_swiftshader_icd.json.tmpl"
"${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/vk_swiftshader_icd.json"
)
if(SWIFTSHADER_EMIT_COVERAGE)
# Emit a coverage-toolchain.txt file next to the vk_swiftshader_icd.json
# file so that regres can locate the LLVM toolchain used to build the
# .so file. With this, the correct llvm-cov and llvm-profdata tools
# from the same toolchain can be located.
get_filename_component(COMPILER_TOOLCHAIN_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
file(WRITE
"${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/coverage-toolchain.txt"
"${COMPILER_TOOLCHAIN_DIR}"
)
endif()
endif()
###########################################################
......
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