Skip to content

Commit 4545768

Browse files
committed
Cleaned up wasm dependencies
1 parent e19e4a7 commit 4545768

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,22 @@ if(EXECUTORCH_BUILD_PYBIND)
796796
endif()
797797

798798
if(EXECUTORCH_BUILD_WASM)
799+
if(NOT EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
800+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
801+
endif()
802+
803+
if(NOT EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR)
804+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/flat_tensor)
805+
endif()
806+
807+
if(NOT EXECUTORCH_BUILD_EXTENSION_MODULE)
808+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/module)
809+
endif()
810+
811+
if(NOT EXECUTORCH_BUILD_EXTENSION_TENSOR)
812+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/tensor)
813+
endif()
814+
799815
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/wasm)
800816
endif()
801817

extension/wasm/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ list(
3737
embind
3838
executorch_core
3939
extension_data_loader
40-
portable_ops_lib
4140
extension_module_static
4241
extension_tensor
4342
extension_runner_util
@@ -49,7 +48,11 @@ target_compile_options(executorch_wasm PUBLIC ${_common_compile_options})
4948
target_include_directories(
5049
executorch_wasm PUBLIC ${_common_include_directories}
5150
)
52-
target_link_libraries(executorch_wasm PUBLIC ${link_libraries})
51+
target_link_libraries(
52+
executorch_wasm
53+
PUBLIC ${link_libraries}
54+
INTERFACE executorch_kernels
55+
)
5356

5457
if(EXECUTORCH_BUILD_WASM_TESTS)
5558
add_subdirectory(test)

extension/wasm/test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ add_custom_target(
4141
)
4242

4343
add_executable(executorch_wasm_tests)
44-
target_link_libraries(executorch_wasm_tests PUBLIC executorch_wasm)
44+
target_link_libraries(executorch_wasm_tests PRIVATE executorch_wasm)
4545
target_link_options(
4646
executorch_wasm_tests
47-
PUBLIC
47+
PRIVATE
4848
--embed-file
4949
"${MODELS_DIR}@/"
5050
--post-js

scripts/build_wasm_tests.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ CMAKE_OUT=cmake-out-wasm
99

1010
cd "$(dirname "${BASH_SOURCE[0]}")/../"
1111
emcmake cmake . -DEXECUTORCH_BUILD_WASM=ON \
12-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
13-
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
14-
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
15-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
16-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
17-
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
12+
-DEXECUTORCH_SELECT_OPS_LIST="aten::mm.out,aten::add.out" \
1813
-DEXECUTORCH_BUILD_WASM_TESTS=ON \
1914
-DCMAKE_BUILD_TYPE=Release \
2015
-B"${CMAKE_OUT}"

0 commit comments

Comments
 (0)