File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff 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 ()
751764endif ()
752765
753766if (EXECUTORCH_BUILD_VULKAN)
@@ -758,10 +771,6 @@ if(EXECUTORCH_BUILD_ANDROID_JNI)
758771 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/android)
759772endif ()
760773
761- if (EXECUTORCH_BUILD_ANDROID_JNI)
762- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/android)
763- endif ()
764-
765774include (Test .cmake)
766775
767776# Print all the configs that were called with announce_configured_options.
You can’t perform that action at this time.
0 commit comments