@@ -36,6 +36,11 @@ include(${EXECUTORCH_SRCS_FILE})
3636
3737# build llama_runner library
3838list (TRANSFORM _llama_runner__srcs PREPEND "${EXECUTORCH_ROOT} /" )
39+ if (WIN32 )
40+ set_property (TARGET extension_module PROPERTY
41+ IMPORTED_IMPLIB "${EXECUTORCH_ROOT} /cmake-out/lib/extension_module.lib" )
42+
43+ endif ()
3944
4045target_include_directories (
4146 extension_module INTERFACE ${_common_include_directories}
@@ -52,7 +57,7 @@ list(APPEND _llama_runner__srcs
5257if (CMAKE_TOOLCHAIN_IOS
5358 OR ANDROID
5459 OR APPLE
55- OR WIN32
60+ OR WIN32
5661)
5762 # Building a share library on iOS requires code signing On Android we see
5863 # duplicated registration when using shared lib
@@ -76,24 +81,13 @@ add_subdirectory(
7681)
7782set (CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag} )
7883
79- if (WIN32 )
80- # in Windows, only extension_module_static works and has duplicated symbols with extension_tensor
81- set (llama_runner_deps executorch extension_data_loader extension_module_static
82- re2::re2
83- )
84- # in Windows, need PUBLIC or sources files in executorch/examples/models/llama/runner/ cannot be found
85- target_include_directories (
86- llama_runner PUBLIC ${_common_include_directories} ${EXECUTORCH_ROOT}
87- )
88- else ()
8984set (llama_runner_deps executorch extension_data_loader extension_module
9085 extension_tensor re2::re2
9186)
92- target_include_directories (
93- llama_runner INTERFACE ${_common_include_directories} ${EXECUTORCH_ROOT}
94- )
95- endif ()
9687
9788target_link_libraries (llama_runner PUBLIC ${llama_runner_deps} )
9889
99- target_compile_options (llama_runner PUBLIC ${_preprocessor_flag} )
90+ target_include_directories (
91+ llama_runner INTERFACE ${_common_include_directories} ${EXECUTORCH_ROOT}
92+ )
93+ target_compile_options (llama_runner PUBLIC ${_preprocessor_flag} )
0 commit comments