Skip to content
Merged
Changes from 7 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
38 changes: 33 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,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 @@ -494,6 +497,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 @@ -502,30 +506,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 @@ -689,6 +700,24 @@ if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
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 gflags)
Expand Down Expand Up @@ -737,14 +766,13 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
endif()

set(CMAKE_EXECUTABLE_SUFFIX ".html")
target_link_options(executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file "${WASM_MODEL_DIR}@/")
target_link_options(
executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file
"${WASM_MODEL_DIR}@/"
)
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
Loading