Adds `IREE_HAL_EXECUTABLE_LOADER_DEPS` cmake var. (#10551)
Libraries in this list are linked in to the loader registration and it
can be used for custom import provider libraries.
Fixes #10548.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 416578f..8ee13a1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,13 @@
# information on how to declare external drivers.
set(IREE_EXTERNAL_HAL_DRIVERS "" CACHE STRING "")
+# Additional executable loader deps to add dependent libraries to any target
+# using the default executable loader registration utilities.
+# TODO(benvanik): extend the deps to encompass the built-in loaders too so that
+# we have one flag. We could also support a list of deps and automatically
+# generate the registration from that via a configure file.
+set(IREE_HAL_EXECUTABLE_LOADER_EXTRA_DEPS "" CACHE STRING "")
+
option(IREE_HAL_DRIVER_DEFAULTS "Sets the default value for all runtime HAL drivers" ON)
# CUDA support must be explicitly enabled.
set(IREE_HAL_DRIVER_CUDA_DEFAULT OFF)
diff --git a/runtime/src/iree/hal/local/loaders/registration/CMakeLists.txt b/runtime/src/iree/hal/local/loaders/registration/CMakeLists.txt
index a808483..7b3cb94 100644
--- a/runtime/src/iree/hal/local/loaders/registration/CMakeLists.txt
+++ b/runtime/src/iree/hal/local/loaders/registration/CMakeLists.txt
@@ -25,6 +25,7 @@
DEPS
iree::base
iree::hal::local
+ ${IREE_HAL_EXECUTABLE_LOADER_EXTRA_DEPS}
${IREE_HAL_EXECUTABLE_LOADER_MODULES}
PUBLIC
)