@@ -354,6 +354,9 @@ add_library(executorch_no_prim_ops ALIAS executorch_core)
354
354
# A list of all configured backends.
355
355
set (_executorch_backends "" )
356
356
357
+ # A list of all configured extensions.
358
+ set (_executorch_extensions "" )
359
+
357
360
target_link_libraries (executorch_core PRIVATE program_schema)
358
361
if (ANDROID)
359
362
target_link_libraries (executorch_core PUBLIC log )
@@ -549,14 +552,17 @@ endif()
549
552
550
553
if (EXECUTORCH_BUILD_EXTENSION_APPLE)
551
554
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/apple )
555
+ list (APPEND _executorch_extensions apple_extension)
552
556
endif ()
553
557
554
558
if (EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
555
559
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/data_loader)
560
+ list (APPEND _executorch_extensions extension_data_loader)
556
561
endif ()
557
562
558
563
if (EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR)
559
564
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/flat_tensor)
565
+ list (APPEND _executorch_extensions extension_flat_tensor)
560
566
endif ()
561
567
562
568
if (EXECUTORCH_BUILD_EXTENSION_MODULE)
@@ -567,26 +573,32 @@ if(EXECUTORCH_BUILD_EXTENSION_MODULE)
567
573
FILES_MATCHING
568
574
PATTERN "*.h"
569
575
)
576
+ list (APPEND _executorch_extensions extension_module_static)
570
577
endif ()
571
578
572
579
if (EXECUTORCH_BUILD_EXTENSION_LLM)
573
580
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/llm/tokenizers)
581
+ list (APPEND _executorch_extensions tokenizers)
574
582
endif ()
575
583
576
584
if (EXECUTORCH_BUILD_EXTENSION_LLM_APPLE)
577
585
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/llm/apple )
586
+ list (APPEND _executorch_extensions extension_llm_apple)
578
587
endif ()
579
588
580
589
if (EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER)
581
590
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/llm/runner)
591
+ list (APPEND _executorch_extensions extension_llm_runner)
582
592
endif ()
583
593
584
594
if (EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL)
585
595
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/runner_util)
596
+ list (APPEND _executorch_extensions extension_runner_util)
586
597
endif ()
587
598
588
599
if (EXECUTORCH_BUILD_EXTENSION_TENSOR)
589
600
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/tensor)
601
+ list (APPEND _executorch_extensions extension_tensor)
590
602
endif ()
591
603
592
604
if (EXECUTORCH_BUILD_PTHREADPOOL AND EXECUTORCH_BUILD_CPUINFO)
@@ -688,6 +700,7 @@ endif()
688
700
689
701
if (EXECUTORCH_BUILD_EXTENSION_TRAINING)
690
702
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/training)
703
+ list (APPEND _executorch_extensions extension_training)
691
704
endif ()
692
705
693
706
if (EXECUTORCH_BUILD_KERNELS_LLM)
@@ -706,11 +719,15 @@ if(EXECUTORCH_BUILD_VULKAN)
706
719
endif ()
707
720
708
721
# Top-level interface targets.
709
- add_library (executorch_backends INTERFACE )
710
722
711
723
# A target containing all configured backends.
724
+ add_library (executorch_backends INTERFACE )
712
725
target_link_libraries (executorch_backends INTERFACE ${_executorch_backends} )
713
726
727
+ # A target containing all configured extensions.
728
+ add_library (executorch_extensions INTERFACE )
729
+ target_link_libraries (executorch_extensions INTERFACE ${_executorch_extensions} )
730
+
714
731
if (EXECUTORCH_BUILD_EXECUTOR_RUNNER)
715
732
# Baseline libraries that executor_runner will link against.
716
733
set (_executor_runner_libs executorch gflags)
0 commit comments