Skip to content

Commit 4bc106e

Browse files
committed
Rename CMake target 'executorch' to 'prim_ops_lib' for clarity
- Renamed executorch target to prim_ops_lib in CMakeLists.txt - Added executorch as an alias for backward compatibility - Updated executorch-config.cmake to use prim_ops_lib - Removed redundant manual target_link_options_shared_lib calls in examples - Updated documentation to reflect the new target name
1 parent 7565342 commit 4bc106e

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

CMakeLists.txt

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,18 +392,21 @@ if(EXECUTORCH_BUILD_PYBIND AND APPLE)
392392
endif()
393393

394394
#
395-
# executorch: Primary runtime library with primitive operators.
395+
# prim_ops_lib: Primary runtime library with primitive operators.
396396
#
397397
# Provides the Program and Method interfaces, along with primitive operators.
398398
# Does not contain portable kernels or other full operators. Does not contain
399399
# any backends.
400400
#
401-
add_library(executorch ${_executorch__srcs})
402-
target_link_libraries(executorch PRIVATE executorch_core)
403-
target_include_directories(executorch PUBLIC ${_common_include_directories})
404-
target_compile_definitions(executorch PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
405-
target_compile_options(executorch PUBLIC ${_common_compile_options})
406-
target_link_options_shared_lib(executorch)
401+
add_library(prim_ops_lib ${_executorch__srcs})
402+
target_link_libraries(prim_ops_lib PRIVATE executorch_core)
403+
target_include_directories(prim_ops_lib PUBLIC ${_common_include_directories})
404+
target_compile_definitions(prim_ops_lib PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
405+
target_compile_options(prim_ops_lib PUBLIC ${_common_compile_options})
406+
target_link_options_shared_lib(prim_ops_lib)
407+
408+
# Legacy alias for backward compatibility during transition
409+
add_library(executorch ALIAS prim_ops_lib)
407410

408411
#
409412
# portable_ops_lib: A library to register core ATen ops using portable kernels,
@@ -469,7 +472,13 @@ install(
469472
PATTERN "*.h"
470473
)
471474
install(
472-
TARGETS executorch executorch_core
475+
TARGETS prim_ops_lib executorch_core
476+
INCLUDES
477+
DESTINATION ${_common_include_directories}
478+
)
479+
#prim_ops_lib install
480+
install(
481+
TARGETS prim_ops_lib executorch_core
473482
INCLUDES
474483
DESTINATION ${_common_include_directories}
475484
)
@@ -709,4 +718,4 @@ if(EXECUTORCH_BUILD_VULKAN)
709718
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
710719
endif()
711720

712-
include(Test.cmake)
721+
include(Test.cmake)

backends/cadence/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ if(EXECUTORCH_CADENCE_CPU_RUNNER)
3131
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake)
3232

3333
set(_common_compile_options -Wno-deprecated-declarations -fPIC)
34-
3534
# Find prebuilt libraries. executorch package should contain portable_ops_lib,
3635
# etdump, bundled_program.
3736
find_package(executorch CONFIG REQUIRED)
38-
target_link_options_shared_lib(executorch)
37+
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
3938
target_link_options_shared_lib(portable_ops_lib)
4039

4140
target_include_directories(executorch INTERFACE ${_common_include_directories})

examples/devtools/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/..)
3737
# Find prebuilt libraries. executorch package should contain portable_ops_lib,
3838
# etdump, bundled_program.
3939
find_package(executorch CONFIG REQUIRED)
40-
target_link_options_shared_lib(executorch)
40+
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
4141
target_link_options_shared_lib(portable_ops_lib)
4242

4343
target_include_directories(executorch INTERFACE ${_common_include_directories})

examples/models/llama/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ find_package(gflags REQUIRED)
8080
# find `executorch` libraries Same as for gflags
8181
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
8282
find_package(executorch CONFIG REQUIRED)
83-
target_link_options_shared_lib(executorch)
8483

8584
# llama_runner library
8685
add_subdirectory(runner)

examples/models/llava/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ find_package(gflags REQUIRED)
7878
# find `executorch` libraries Same as for gflags
7979
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
8080
find_package(executorch CONFIG REQUIRED)
81-
target_link_options_shared_lib(executorch)
81+
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
8282

8383
# llava_runner library
8484
add_subdirectory(runner)

extension/android/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ set_target_properties(fbjni PROPERTIES
6262

6363
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../lib/cmake/ExecuTorch)
6464
find_package(executorch CONFIG REQUIRED)
65-
target_link_options_shared_lib(executorch)
65+
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
6666

6767
add_library(executorch_jni SHARED jni/jni_layer.cpp jni/log.cpp jni/jni_layer_runtime.cpp)
6868

tools/cmake/executorch-config.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ endforeach()
5555
set(EXECUTORCH_FOUND ON)
5656

5757
target_link_libraries(executorch INTERFACE executorch_core)
58+
target_link_options_shared_lib(prim_ops_lib)
5859

5960
set(lib_list
6061
flatccrt

0 commit comments

Comments
 (0)