File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -836,13 +836,13 @@ if(EXECUTORCH_BUILD_VULKAN)
836836 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /backends/vulkan)
837837endif ()
838838
839- if (EXECUTORCH_BUILD_TORCHAO)
840- add_compile_options ("-frtti" )
841- set (EXECUTORCH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} /..)
842- set (EXECUTORCH_LIBRARIES executorch extension_threadpool) # cpuinfo pthreadpool)
843- set (TORCHAO_BUILD_EXECUTORCH_OPS ON )
844- add_subdirectory (third-party/ao/torchao/experimental)
845- endif ()
839+ # if(EXECUTORCH_BUILD_TORCHAO)
840+ # add_compile_options("-frtti")
841+ # set(EXECUTORCH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..)
842+ # set(EXECUTORCH_LIBRARIES executorch extension_threadpool) # cpuinfo pthreadpool)
843+ # set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
844+ # add_subdirectory(third-party/ao/torchao/experimental)
845+ # endif()
846846
847847# Print all summary
848848executorch_print_configuration_summary()
Original file line number Diff line number Diff line change @@ -122,12 +122,20 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
122122endif ()
123123
124124if (EXECUTORCH_BUILD_TORCHAO)
125- set (torchao_DIR ${CMAKE_CURRENT_BINARY_DIR} /../../../lib/cmake/torchao)
126- find_package (torchao REQUIRED)
127- target_link_options_shared_lib(torchao::torchao_ops_executorch)
128- list (APPEND link_libraries torchao::torchao_ops_executorch)
125+ # Method1: torchao has a config
126+ # set(torchao_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/torchao)
127+ # find_package(torchao REQUIRED)
128+ # target_link_options_shared_lib(torchao::torchao_ops_executorch)
129+ # list(APPEND link_libraries torchao::torchao_ops_executorch)
130+
131+ # Method2: torchao is built at top-level CMakeLists.txt
129132 # list(APPEND link_libraries "$<LINK_LIBRARY:WHOLE_ARCHIVE,${CMAKE_CURRENT_BINARY_DIR}/../../../lib/libtorchao_ops_executorch.a>")
130133 # list(APPEND link_libraries "${CMAKE_CURRENT_BINARY_DIR}/../../../lib/libtorchao_kernels_aarch64.a")
134+
135+ # Method3: submodule
136+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /../../../third-party/ao/torchao/experimental ${CMAKE_CURRENT_BINARY_DIR} /../../../third-party/ao/torchao/experimental)
137+ target_link_options_shared_lib(torchao_ops_executorch)
138+ list (APPEND link_libraries torchao_ops_executorch)
131139endif ()
132140
133141set (XNNPACK_ROOT ${CMAKE_CURRENT_SOURCE_DIR} /../../../backends/xnnpack)
You can’t perform that action at this time.
0 commit comments