Skip to content

Commit fcf5d1f

Browse files
jathujathu
jathu
authored andcommitted
make extension_module static
1 parent 0fddf9d commit fcf5d1f

File tree

6 files changed

+8
-29
lines changed

6 files changed

+8
-29
lines changed

docs/source/llm/getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ add_executable(nanogpt_runner main.cpp)
376376
target_link_libraries(
377377
nanogpt_runner
378378
PRIVATE executorch
379-
extension_module_static # Provides the Module class
379+
extension_module # Provides the Module class
380380
extension_tensor # Provides the TensorPtr class
381381
optimized_native_cpu_ops_lib # Provides baseline cross-platform
382382
# kernels
@@ -533,7 +533,7 @@ add_executable(nanogpt_runner main.cpp)
533533
target_link_libraries(
534534
nanogpt_runner
535535
PRIVATE executorch
536-
extension_module_static # Provides the Module class
536+
extension_module # Provides the Module class
537537
extension_tensor # Provides the TensorPtr class
538538
optimized_native_cpu_ops_lib # Provides baseline cross-platform
539539
# kernels
@@ -672,7 +672,7 @@ target_link_libraries(
672672
nanogpt_runner
673673
PRIVATE
674674
executorch
675-
extension_module_static # Provides the Module class
675+
extension_module # Provides the Module class
676676
optimized_native_cpu_ops_lib # Provides baseline cross-platform kernels
677677
xnnpack_backend) # Provides the XNNPACK CPU acceleration backend
678678
```

examples/llm_manual/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ add_executable(nanogpt_runner main.cpp)
2727
target_link_libraries(
2828
nanogpt_runner
2929
PRIVATE executorch
30-
extension_module_static # Provides the Module class
30+
extension_module # Provides the Module class
3131
extension_tensor # Provides the TensorPtr class
3232
optimized_native_cpu_ops_lib # Provides baseline cross-platform
3333
# kernels

examples/models/phi-3-mini/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ target_include_directories(
4949
${CMAKE_CURRENT_SOURCE_DIR}/../../../extension/llm/tokenizers/include
5050
)
5151
target_link_libraries(
52-
phi_3_mini_runner PRIVATE executorch extension_module_static extension_tensor
52+
phi_3_mini_runner PRIVATE executorch extension_module extension_tensor
5353
optimized_native_cpu_ops_lib xnnpack_backend gflags
5454
)

extension/module/CMakeLists.txt

+2-22
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,16 @@ if(NOT EXECUTORCH_ROOT)
1717
endif()
1818

1919
list(TRANSFORM _extension_module__srcs PREPEND "${EXECUTORCH_ROOT}/")
20-
if(CMAKE_TOOLCHAIN_IOS
21-
OR CMAKE_TOOLCHAIN_ANDROID
22-
OR APPLE
23-
)
24-
# Building a share library on iOS requires code signing On Android we see
25-
# duplicated registration when using shared lib
26-
add_library(extension_module STATIC ${_extension_module__srcs})
27-
else()
28-
add_library(extension_module SHARED ${_extension_module__srcs})
29-
endif()
20+
add_library(extension_module STATIC ${_extension_module__srcs})
3021
target_link_libraries(extension_module PRIVATE executorch extension_data_loader extension_flat_tensor)
3122
target_include_directories(extension_module PUBLIC ${EXECUTORCH_ROOT}/..)
3223
target_compile_options(
3324
extension_module PUBLIC -Wno-deprecated-declarations -fPIC
3425
)
3526

36-
# Module extension built as a static library. TODO(gjcomer) Remove this target
37-
# after cleaning up CMake targets.
38-
add_library(extension_module_static STATIC ${_extension_module__srcs})
39-
target_link_libraries(
40-
extension_module_static PRIVATE executorch extension_data_loader extension_flat_tensor
41-
)
42-
target_include_directories(extension_module_static PUBLIC ${EXECUTORCH_ROOT}/..)
43-
target_compile_options(
44-
extension_module_static PUBLIC -Wno-deprecated-declarations -fPIC
45-
)
46-
4727
# Install libraries
4828
install(
49-
TARGETS extension_module extension_module_static
29+
TARGETS extension_module
5030
DESTINATION lib
5131
INCLUDES
5232
DESTINATION ${_common_include_directories}

extension/module/test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ et_cxx_test(
2525
${_test_srcs}
2626
EXTRA_LIBS
2727
extension_data_loader
28-
extension_module_static
28+
extension_module
2929
extension_tensor
3030
portable_kernels
3131
portable_ops_lib

tools/cmake/executorch-config.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ set(lib_list
7676
portable_ops_lib
7777
custom_ops
7878
extension_module
79-
extension_module_static
8079
extension_runner_util
8180
extension_tensor
8281
extension_threadpool

0 commit comments

Comments
 (0)