diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2023-07-20 08:31:37 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2023-07-20 08:44:58 -0500 |
commit | cf269417b20fc768d36ab55dbfd9187d256534ae (patch) | |
tree | 1b615b38a5ff8117ad6d3970e7beef14977ca578 /libc | |
parent | cde5e4281b097404a879e2592cf41d0cec138715 (diff) | |
download | llvm-cf269417b20fc768d36ab55dbfd9187d256534ae.zip llvm-cf269417b20fc768d36ab55dbfd9187d256534ae.tar.gz llvm-cf269417b20fc768d36ab55dbfd9187d256534ae.tar.bz2 |
[libc] Add an override option for specifying the loader implementation
There are some cases when testing we want to override the logic for not
building tests if the loader is not present. This allows users to
specify an external binary that fulfils the same duties which will force
the tests to be built even without meeting the dependencies.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D155837
Diffstat (limited to 'libc')
-rw-r--r-- | libc/utils/gpu/loader/CMakeLists.txt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libc/utils/gpu/loader/CMakeLists.txt b/libc/utils/gpu/loader/CMakeLists.txt index 65f346d..f195b88 100644 --- a/libc/utils/gpu/loader/CMakeLists.txt +++ b/libc/utils/gpu/loader/CMakeLists.txt @@ -29,7 +29,15 @@ else() endif() # Add a custom target to be used for testing. -if(TARGET amdhsa_loader AND LIBC_GPU_TARGET_ARCHITECTURE_IS_AMDGPU) +set(LIBC_GPU_LOADER_EXECUTABLE "" CACHE STRING "Overriding binary for the GPU loader.") +if(LIBC_GPU_LOADER_EXECUTABLE) + add_custom_target(libc.utils.gpu.loader) + set_target_properties( + libc.utils.gpu.loader + PROPERTIES + EXECUTABLE "${LIBC_GPU_LOADER_EXECUTABLE}" + ) +elseif(TARGET amdhsa_loader AND LIBC_GPU_TARGET_ARCHITECTURE_IS_AMDGPU) add_custom_target(libc.utils.gpu.loader) add_dependencies(libc.utils.gpu.loader amdhsa_loader) set_target_properties( |