Skip to content

Commit 6871938

Browse files
tarun292facebook-github-bot
authored andcommitted
CMake changes to build bundled_program and bundled_executor_runner with ETDump (#653)
Summary: Pull Request resolved: #653 Reviewed By: larryliu0820 Differential Revision: D49991850 Pulled By: tarun292 fbshipit-source-id: 22e08eee58bb1b41746f9af4b6bbc93be39c8c30
1 parent 737186e commit 6871938

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ option(EXECUTORCH_BUILD_XNNPACK
132132
option(EXECUTORCH_BUILD_SDK
133133
"Build the ExecuTorch SDK library and the SDK example runner.")
134134

135+
option(EXECUTORCH_BUILD_EXAMPLES "Build the ExecuTorch examples.")
136+
135137
if(NOT BUCK2)
136138
set(BUCK2 buck2)
137139
endif()
@@ -346,6 +348,11 @@ endif()
346348

347349
if(EXECUTORCH_BUILD_SDK)
348350
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/sdk)
351+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util)
352+
endif()
353+
354+
if(EXECUTORCH_BUILD_EXAMPLES)
355+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples)
349356
endif()
350357

351358
# Print all summary

examples/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
add_executable(bundled_executor_runner
8+
bundled_executor_runner/bundled_executor_runner.cpp)
9+
target_compile_options(executorch PUBLIC -DET_EVENT_TRACER_ENABLED)
10+
target_compile_options(portable_ops_lib PUBLIC -DET_EVENT_TRACER_ENABLED)
11+
target_link_libraries(
12+
bundled_executor_runner
13+
executorch
14+
gflags
15+
etdump
16+
extension_data_loader
17+
flatcc
18+
bundled_program
19+
portable_ops_lib)

sdk/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ target_link_libraries(
8989
PRIVATE executorch)
9090

9191
target_include_directories(
92-
etdump PRIVATE ${_program_schema__include_dir}
93-
${CMAKE_SOURCE_DIR}/third-party/flatcc/include)
92+
etdump PUBLIC ${_program_schema__include_dir}
93+
${CMAKE_SOURCE_DIR}/third-party/flatcc/include)

util/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
add_library(bundled_program
8+
${CMAKE_CURRENT_SOURCE_DIR}/bundled_program_verification.cpp)
9+
10+
target_link_libraries(bundled_program executorch bundled_schema)

0 commit comments

Comments
 (0)