@@ -383,6 +383,9 @@ add_library(executorch_no_prim_ops ALIAS executorch_core)
383
383
# A list of all configured backends.
384
384
set (_executorch_backends "" )
385
385
386
+ # A list of all configured extensions.
387
+ set (_executorch_extensions "" )
388
+
386
389
target_link_libraries (executorch_core PRIVATE program_schema )
387
390
if (ANDROID )
388
391
target_link_libraries (executorch_core PUBLIC log )
@@ -579,6 +582,7 @@ endif()
579
582
580
583
if (EXECUTORCH_BUILD_EXTENSION_APPLE )
581
584
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/apple )
585
+ list (APPEND _executorch_extensions apple_extension )
582
586
endif ()
583
587
584
588
if (EXECUTORCH_BUILD_EXTENSION_DATA_LOADER )
@@ -589,6 +593,7 @@ if(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
589
593
FILES_MATCHING
590
594
PATTERN "*.h"
591
595
)
596
+ list (APPEND _executorch_extensions extension_data_loader )
592
597
endif ()
593
598
594
599
if (EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL )
@@ -603,6 +608,7 @@ endif()
603
608
604
609
if (EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR )
605
610
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/flat_tensor )
611
+ list (APPEND _executorch_extensions extension_flat_tensor )
606
612
endif ()
607
613
608
614
if (EXECUTORCH_BUILD_EXTENSION_MODULE )
@@ -613,6 +619,7 @@ if(EXECUTORCH_BUILD_EXTENSION_MODULE)
613
619
FILES_MATCHING
614
620
PATTERN "*.h"
615
621
)
622
+ list (APPEND _executorch_extensions extension_module_static )
616
623
endif ()
617
624
618
625
if (EXECUTORCH_BUILD_EXTENSION_LLM )
@@ -632,14 +639,17 @@ if(EXECUTORCH_BUILD_EXTENSION_LLM)
632
639
${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG}
633
640
)
634
641
endif ()
642
+ list (APPEND _executorch_extensions tokenizers )
635
643
endif ()
636
644
637
645
if (EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER )
638
646
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/llm/runner )
647
+ list (APPEND _executorch_extensions extension_llm_runner )
639
648
endif ()
640
649
641
650
if (EXECUTORCH_BUILD_EXTENSION_LLM_APPLE )
642
651
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/llm/apple )
652
+ list (APPEND _executorch_extensions extension_llm_apple )
643
653
endif ()
644
654
645
655
if (EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL )
@@ -650,10 +660,12 @@ if(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL)
650
660
FILES_MATCHING
651
661
PATTERN "*.h"
652
662
)
663
+ list (APPEND _executorch_extensions extension_runner_util )
653
664
endif ()
654
665
655
666
if (EXECUTORCH_BUILD_EXTENSION_TENSOR )
656
667
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/tensor )
668
+ list (APPEND _executorch_extensions extension_tensor )
657
669
endif ()
658
670
659
671
if (EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO )
@@ -756,6 +768,7 @@ endif()
756
768
757
769
if (EXECUTORCH_BUILD_EXTENSION_TRAINING )
758
770
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/training )
771
+ list (APPEND _executorch_extensions extension_training )
759
772
endif ()
760
773
761
774
if (EXECUTORCH_BUILD_KERNELS_LLM )
@@ -778,25 +791,22 @@ if(EXECUTORCH_BUILD_VGF)
778
791
list (APPEND _executorch_backends vgf_backend )
779
792
endif ()
780
793
781
-
782
794
# Top-level interface targets.
783
- add_library (executorch_backends INTERFACE )
784
- add_library (executorch::backends ALIAS executorch_backends )
785
795
786
796
# A target containing all configured backends.
797
+ add_library (executorch_backends INTERFACE )
798
+ add_library (executorch::backends ALIAS executorch_backends )
787
799
target_link_libraries (executorch_backends INTERFACE ${_executorch_backends} )
788
800
789
- install (
790
- TARGETS executorch_backends
791
- INCLUDES
792
- DESTINATION ${_common_include_directories}
793
- )
801
+ # A target containing all configured extensions.
802
+ add_library (executorch_extensions INTERFACE )
803
+ add_library (executorch::extensions ALIAS executorch_extensions )
804
+ target_link_libraries (executorch_extensions INTERFACE ${_executorch_extensions} )
794
805
795
806
if (EXECUTORCH_BUILD_EXECUTOR_RUNNER )
796
807
# Baseline libraries that executor_runner will link against.
797
808
set (_executor_runner_libs executorch extension_evalue_util
798
- extension_runner_util gflags
799
- executorch_backends
809
+ extension_runner_util gflags executorch_backends
800
810
)
801
811
802
812
if (EXECUTORCH_BUILD_KERNELS_OPTIMIZED )
0 commit comments