@@ -122,35 +122,8 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
122122endif ()
123123
124124if (EXECUTORCH_BUILD_TORCHAO)
125-   include (ExternalProject)
126-   # set(TORCHAO_BUILD_EXECUTORCH_OPS ON) 
127- 
128-   ExternalProject_Add(
129-       torchao
130-       PREFIX  ${CMAKE_BINARY_DIR} /../../../third-party/ao/torchao/experimental
131-       SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} /../../../third-party/ao/torchao/experimental
132-       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=cmake-out
133-         -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} 
134-         -DTORCHAO_BUILD_EXECUTORCH_OPS=ON 
135-         -DEXECUTORCH_INCLUDE_DIRS=$HOME/repos
136-         -DEXECUTORCH_LIBRARIES=${CMAKE_BINARY_DIR} /lib/libexecutorch.a;$HOME/repos/executorch/cmake-out/lib/libextension_threadpool.a;$HOME/repos/executorch/cmake-out/lib/libcpuinfo.a;$HOME/repos/executorch/cmake-out/lib/libpthreadpool.a
137-   )
138-   set (TORCHAO_BUILD_EXECUTORCH_OPS ON )
139-   add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /../../../third-party/ao/torchao/experimental ${CMAKE_CURRENT_BINARY_DIR} /../../../third-party/ao/torchao/experimental)
140- 
141-   set (torchao_DIR /Users/scroy/repos/executorch/cmake-out/lib/cmake/torchao)
142-   find_package (torchao REQUIRED)
143- 
144-   # set(torchao_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/ao/torchao/experimental) 
145-   # find_package(torchao CONFIG REQUIRED) 
146- 
147-   # find_package(Torch CONFIG REQUIRED HINT ${CMAKE_PREFIX_PATH}/torch/share/cmake/Torch) 
148-   # add_compile_options("-frtti") 
149-   # set(Torch_DIR /opt/miniconda3/envs/et_env/lib/python3.10/site-packages/torch/share/cmake/Torch) 
150- 
151-   # add_subdirectory(third-party/ao/torchao/experimental) 
152-   target_link_options_shared_lib(torchao::torchao_ops_executorch)
153-   list (APPEND  link_libraries  torchao::torchao_ops_executorch)
125+   list (APPEND  link_libraries  "$<LINK_LIBRARY:WHOLE_ARCHIVE,${CMAKE_CURRENT_BINARY_DIR} /../../../lib/libtorchao_ops_executorch.a>" )
126+   list (APPEND  link_libraries  "${CMAKE_CURRENT_BINARY_DIR} /../../../lib/libtorchao_kernels_aarch64.a" )
154127endif ()
155128
156129set (XNNPACK_ROOT ${CMAKE_CURRENT_SOURCE_DIR} /../../../backends/xnnpack)
0 commit comments