@@ -380,6 +380,9 @@ add_library(executorch_core ${_executorch_core__srcs})
380
380
# Legacy name alias.
381
381
add_library (executorch_no_prim_ops ALIAS executorch_core)
382
382
383
+ # A list of all configured backends.
384
+ set (_executorch_backends "" )
385
+
383
386
target_link_libraries (executorch_core PRIVATE program_schema)
384
387
if (ANDROID)
385
388
target_link_libraries (executorch_core PUBLIC log )
@@ -524,6 +527,7 @@ install(FILES tools/cmake/executorch-config.cmake
524
527
525
528
if (EXECUTORCH_BUILD_ARM_BAREMETAL)
526
529
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/arm)
530
+ list (APPEND _executorch_backends executorch_delegate_ethos_u)
527
531
endif ()
528
532
529
533
if (EXECUTORCH_BUILD_CADENCE)
@@ -532,30 +536,37 @@ endif()
532
536
533
537
if (EXECUTORCH_BUILD_NXP_NEUTRON)
534
538
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/nxp)
539
+ list (APPEND _executorch_backends executorch_delegate_neutron)
535
540
endif ()
536
541
537
542
if (EXECUTORCH_BUILD_COREML)
538
543
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/apple /coreml)
544
+ list (APPEND _executorch_backends coremldelegate)
539
545
endif ()
540
546
541
547
if (EXECUTORCH_BUILD_MPS)
542
548
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/apple /mps)
549
+ list (APPEND _executorch_backends mpsdelegate)
543
550
endif ()
544
551
545
552
if (EXECUTORCH_BUILD_NEURON)
546
553
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/mediatek)
554
+ list (APPEND _executorch_backends neuron_backend)
547
555
endif ()
548
556
549
557
if (EXECUTORCH_BUILD_OPENVINO)
550
558
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/openvino)
559
+ list (APPEND _executorch_backends openvino_backend)
551
560
endif ()
552
561
553
562
if (EXECUTORCH_BUILD_QNN)
554
563
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/qualcomm)
564
+ list (APPEND _executorch_backends qnn_executorch_backend)
555
565
endif ()
556
566
557
567
if (EXECUTORCH_BUILD_XNNPACK)
558
568
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/xnnpack)
569
+ list (APPEND _executorch_backends xnnpack_backend)
559
570
endif ()
560
571
561
572
if (EXECUTORCH_BUILD_CORTEX_M)
@@ -757,10 +768,35 @@ if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
757
768
executorch_target_link_options_shared_lib(quantized_ops_lib)
758
769
endif ()
759
770
771
+ if (EXECUTORCH_BUILD_VULKAN)
772
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/vulkan)
773
+ list (APPEND _executorch_backends vulkan_backend vulkan_schema)
774
+ endif ()
775
+
776
+ if (EXECUTORCH_BUILD_VGF)
777
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/arm)
778
+ list (APPEND _executorch_backends vgf_backend)
779
+ endif ()
780
+
781
+
782
+ # Top-level interface targets.
783
+ add_library (executorch_backends INTERFACE )
784
+ add_library (executorch::backends ALIAS executorch_backends)
785
+
786
+ # A target containing all configured backends.
787
+ target_link_libraries (executorch_backends INTERFACE ${_executorch_backends} )
788
+
789
+ install (
790
+ TARGETS executorch_backends
791
+ INCLUDES
792
+ DESTINATION ${_common_include_directories}
793
+ )
794
+
760
795
if (EXECUTORCH_BUILD_EXECUTOR_RUNNER)
761
796
# Baseline libraries that executor_runner will link against.
762
797
set (_executor_runner_libs executorch extension_evalue_util
763
798
extension_runner_util gflags
799
+ executorch_backends
764
800
)
765
801
766
802
if (EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
@@ -780,18 +816,10 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
780
816
list (APPEND _executor_runner_libs $<LINK_LIBRARY:WHOLE_ARCHIVE,custom_ops>)
781
817
endif ()
782
818
783
- if (EXECUTORCH_BUILD_XNNPACK)
784
- list (APPEND _executor_runner_libs xnnpack_backend)
785
- endif ()
786
-
787
819
if (EXECUTORCH_ENABLE_EVENT_TRACER)
788
820
list (APPEND _executor_runner_libs etdump flatccrt)
789
821
endif ()
790
822
791
- if (EXECUTORCH_BUILD_COREML AND APPLE )
792
- list (APPEND _executor_runner_libs coremldelegate)
793
- endif ()
794
-
795
823
add_executable (executor_runner ${_executor_runner__srcs} )
796
824
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
797
825
target_link_options_gc_sections(executor_runner)
@@ -814,14 +842,6 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
814
842
endif ()
815
843
endif ()
816
844
817
- if (EXECUTORCH_BUILD_VULKAN)
818
- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/vulkan)
819
- endif ()
820
- if (EXECUTORCH_BUILD_VGF)
821
- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/arm)
822
- endif ()
823
-
824
-
825
845
if (EXECUTORCH_BUILD_ANDROID_JNI)
826
846
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/android)
827
847
endif ()
0 commit comments