Skip to content

Commit 1a6d403

Browse files
committed
Update
[ghstack-poisoned]
1 parent d562557 commit 1a6d403

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

CMakeLists.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,19 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
748748
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
749749
target_link_options_gc_sections(executor_runner)
750750
endif()
751+
target_link_libraries(executor_runner ${_executor_runner_libs})
752+
target_compile_options(executor_runner PUBLIC ${_common_compile_options})
753+
754+
# Automatically set when using `emcmake cmake` for Wasm build.
755+
if(EMSCRIPTEN)
756+
# Directory of model pte files to embed in the wasm binary.
757+
if(NOT DEFINED WASM_MODEL_DIR)
758+
set(WASM_MODEL_DIR "${CMAKE_SOURCE_DIR}/models/")
759+
endif()
760+
761+
set(CMAKE_EXECUTABLE_SUFFIX ".html")
762+
target_link_options(executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file "${WASM_MODEL_DIR}@/")
763+
endif()
751764
endif()
752765

753766
if(EXECUTORCH_BUILD_VULKAN)
@@ -758,10 +771,6 @@ if(EXECUTORCH_BUILD_ANDROID_JNI)
758771
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)
759772
endif()
760773

761-
if(EXECUTORCH_BUILD_ANDROID_JNI)
762-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)
763-
endif()
764-
765774
include(Test.cmake)
766775

767776
# Print all the configs that were called with announce_configured_options.

0 commit comments

Comments
 (0)