Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 30 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ add_library(executorch_core ${_executorch_core__srcs})
# Legacy name alias.
add_library(executorch_no_prim_ops ALIAS executorch_core)

# A list of all configured backends.
set(_executorch_backends "")

target_link_libraries(executorch_core PRIVATE program_schema)
if(ANDROID)
target_link_libraries(executorch_core PUBLIC log)
Expand Down Expand Up @@ -498,6 +501,7 @@ install(FILES tools/cmake/Utils.cmake tools/cmake/executorch-config.cmake

if(EXECUTORCH_BUILD_ARM_BAREMETAL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/arm)
list(APPEND _executorch_backends executorch_delegate_ethos_u)
endif()

if(EXECUTORCH_BUILD_CADENCE)
Expand All @@ -506,30 +510,37 @@ endif()

if(EXECUTORCH_BUILD_NXP_NEUTRON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/nxp)
list(APPEND _executorch_backends executorch_delegate_neutron)
endif()

if(EXECUTORCH_BUILD_COREML)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/apple/coreml)
list(APPEND _executorch_backends coremldelegate)
endif()

if(EXECUTORCH_BUILD_MPS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/apple/mps)
list(APPEND _executorch_backends mpsdelegate)
endif()

if(EXECUTORCH_BUILD_NEURON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/mediatek)
list(APPEND _executorch_backends neuron_backend)
endif()

if(EXECUTORCH_BUILD_OPENVINO)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/openvino)
list(APPEND _executorch_backends openvino_backend)
endif()

if(EXECUTORCH_BUILD_QNN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/qualcomm)
list(APPEND _executorch_backends qnn_executorch_backend)
endif()

if(EXECUTORCH_BUILD_XNNPACK)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/xnnpack)
list(APPEND _executorch_backends xnnpack_backend)
endif()

if(EXECUTORCH_BUILD_CORTEX_M)
Expand Down Expand Up @@ -708,10 +719,29 @@ if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
executorch_target_link_options_shared_lib(quantized_ops_lib)
endif()

if(EXECUTORCH_BUILD_VULKAN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
list(APPEND _executorch_backends vulkan_backend)
endif()

# Top-level interface targets.
add_library(executorch_backends INTERFACE)
add_library(executorch::backends ALIAS executorch_backends)

# A target containing all configured backends.
target_link_libraries(executorch_backends INTERFACE ${_executorch_backends})

install(
TARGETS executorch_backends
INCLUDES
DESTINATION ${_common_include_directories}
)

if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
# Baseline libraries that executor_runner will link against.
set(_executor_runner_libs executorch extension_evalue_util
extension_runner_util gflags
executorch_backends
)

if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
Expand All @@ -731,18 +761,10 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
list(APPEND _executor_runner_libs $<LINK_LIBRARY:WHOLE_ARCHIVE,custom_ops>)
endif()

if(EXECUTORCH_BUILD_XNNPACK)
list(APPEND _executor_runner_libs xnnpack_backend)
endif()

if(EXECUTORCH_ENABLE_EVENT_TRACER)
list(APPEND _executor_runner_libs etdump flatccrt)
endif()

if(EXECUTORCH_BUILD_COREML AND APPLE)
list(APPEND _executor_runner_libs coremldelegate)
endif()

add_executable(executor_runner ${_executor_runner__srcs})
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_options_gc_sections(executor_runner)
Expand All @@ -765,10 +787,6 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
endif()
endif()

if(EXECUTORCH_BUILD_VULKAN)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
endif()

if(EXECUTORCH_BUILD_ANDROID_JNI)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)
endif()
Expand Down
14 changes: 0 additions & 14 deletions backends/vulkan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,6 @@ executorch_target_link_options_shared_lib(vulkan_backend)

set_property(TARGET vulkan_backend PROPERTY CXX_STANDARD 17)

# Executor Runner

if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
set(VULKAN_RUNNER_SRCS ${_executor_runner__srcs})
list(TRANSFORM VULKAN_RUNNER_SRCS PREPEND "${EXECUTORCH_ROOT}/")

add_executable(vulkan_executor_runner ${VULKAN_RUNNER_SRCS})
target_link_libraries(
vulkan_executor_runner ${_executor_runner_libs} vulkan_schema
vulkan_backend
)
target_compile_options(vulkan_executor_runner PUBLIC ${VULKAN_CXX_FLAGS})
endif()

# Test targets

install(
Expand Down
Loading