Skip to content

Commit 68cec51

Browse files
committed
changes
1 parent 3285999 commit 68cec51

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@ cmake_dependent_option(
240240
"NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF
241241
)
242242

243+
if(EXECUTORCH_BUILD_PYBIND)
244+
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
245+
set(EXECUTORCH_BUILD_DEVTOOLS ON)
246+
endif()
247+
248+
if(EXECUTORCH_BUILD_EXTENSION_TRAINING)
249+
set(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
250+
set(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON)
251+
set(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
252+
endif()
253+
243254
if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
244255
set(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
245256
set(EXECUTORCH_BUILD_KERNELS_CUSTOM ON)
@@ -713,14 +724,6 @@ endif()
713724
if(EXECUTORCH_BUILD_PYBIND)
714725
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/pybind11)
715726

716-
if(NOT EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
717-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
718-
endif()
719-
720-
if(NOT EXECUTORCH_BUILD_DEVTOOLS)
721-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
722-
endif()
723-
724727
# find pytorch lib, to allow pybind to take at::Tensor as input/output
725728
find_package(Torch CONFIG REQUIRED)
726729
find_library(
@@ -816,7 +819,6 @@ if(EXECUTORCH_BUILD_PYBIND)
816819
target_compile_options(_training_lib PUBLIC ${_pybind_compile_options})
817820
target_link_libraries(_training_lib PRIVATE ${_pybind_training_dep_libs})
818821

819-
message(STATUS "Installing Training Lib")
820822
install(TARGETS _training_lib
821823
LIBRARY DESTINATION executorch/extension/training/pybindings
822824
)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ def run(self):
585585
cmake_args += [
586586
"-DEXECUTORCH_BUILD_EXTENSION_TRAINING=ON",
587587
]
588+
build_args += ["--target", "_training_lib"]
588589
build_args += ["--target", "portable_lib"]
589590
# To link backends into the portable_lib target, callers should
590591
# add entries like `-DEXECUTORCH_BUILD_XNNPACK=ON` to the CMAKE_ARGS

0 commit comments

Comments
 (0)