Skip to content

refactor no longer needed EXECUTORCH_BUILD_HOST_TARGETS #10320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -410,20 +410,6 @@ endif()
message(STATUS "executorch: Using sources file ${EXECUTORCH_SRCS_FILE}")
include(${EXECUTORCH_SRCS_FILE})

#
# Modify default options when cross-compiling.
#
# The intent is for the EXECUTORCH_BUILD_HOST_TARGETS option to affect the
# default ON/OFF values of host targets around the tree. This way, a user can
# disable EXECUTORCH_BUILD_HOST_TARGETS to disable all host targets, and then
# optionally re-enable some of those targets. Or they could leave
# EXECUTORCH_BUILD_HOST_TARGETS enabled and then optionally disable any given
# host target.
#
# We can then use various cross-compilation hints to set the default value of
# EXECUTORCH_BUILD_HOST_TARGETS, which can still be overridden if desired.
#

# Detect if an iOS toolchain is set.
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
set(CMAKE_TOOLCHAIN_IOS ON)
Expand Down Expand Up @@ -458,16 +444,6 @@ if(EXECUTORCH_USE_CPP_CODE_COVERAGE)
endif()
endif()

# EXECUTORCH_BUILD_HOST_TARGETS: Option to control the building of host-only
# tools like `flatc`, along with example executables like `executor_runner` and
# libraries that it uses, like `gflags`. Disabling this can be helpful when
# cross-compiling, but some required tools that would have been built need to be
# provided directly.
cmake_dependent_option(
EXECUTORCH_BUILD_HOST_TARGETS "Build host-only targets." ON
"NOT CMAKE_TOOLCHAIN_IOS" OFF
)

#
# flatc: Flatbuffer commandline tool to generate .h files from .fbs files
#
Expand Down Expand Up @@ -665,10 +641,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/configurations)
#
# gflags: Commandline flag host library.
#
cmake_dependent_option(
EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON
EXECUTORCH_BUILD_HOST_TARGETS OFF
)
option(EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON)
if(EXECUTORCH_BUILD_GFLAGS)
add_subdirectory(third-party/gflags)
endif()
Expand All @@ -692,10 +665,7 @@ install(FILES tools/cmake/executorch-config.cmake DESTINATION lib/cmake/ExecuTor
#
# executor_runner: Host tool that demonstrates program execution.
#
cmake_dependent_option(
EXECUTORCH_BUILD_EXECUTOR_RUNNER "Build the executor_runner executable" ON
EXECUTORCH_BUILD_HOST_TARGETS OFF
)
option(EXECUTORCH_BUILD_EXECUTOR_RUNNER "Build the executor_runner executable" ON)

# Add googletest if any test targets should be built
if(BUILD_TESTING)
Expand Down
2 changes: 0 additions & 2 deletions backends/cadence/build_cadence_fusionG3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if $STEPWISE_BUILD; then
-DCMAKE_TOOLCHAIN_FILE=/home/zonglinpeng/ws/zonglinpeng/executorch/backends/cadence/cadence.cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
-DEXECUTORCH_BUILD_CADENCE=ON \
Expand All @@ -65,7 +64,6 @@ else
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
-DEXECUTORCH_BUILD_CPUINFO=OFF \
Expand Down
2 changes: 0 additions & 2 deletions backends/cadence/build_cadence_hifi4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ if $STEPWISE_BUILD; then
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
-DEXECUTORCH_BUILD_CADENCE=ON \
Expand All @@ -63,7 +62,6 @@ else
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON \
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
-DEXECUTORCH_BUILD_CPUINFO=OFF \
Expand Down
1 change: 0 additions & 1 deletion docs/source/backends-cadence.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ cmake -DCMAKE_TOOLCHAIN_FILE=<path_to_executorch>/backends/cadence/cadence.cmake
-DCMAKE_BUILD_TYPE=Debug \
-DPYTHON_EXECUTABLE=python3 \
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
-DEXECUTORCH_BUILD_HOST_TARGETS=ON \
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
-DEXECUTORCH_BUILD_CPUINFO=OFF \
Expand Down
3 changes: 0 additions & 3 deletions tools/cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ function(executorch_print_configuration_summary)
STATUS
" EXECUTORCH_BUILD_GFLAGS : ${EXECUTORCH_BUILD_GFLAGS}"
)
message(STATUS " EXECUTORCH_BUILD_HOST_TARGETS : "
"${EXECUTORCH_BUILD_HOST_TARGETS}"
)
message(STATUS " EXECUTORCH_BUILD_KERNELS_CUSTOM : "
"${EXECUTORCH_BUILD_KERNELS_CUSTOM}"
)
Expand Down
Loading