Skip to content

format even more CMakeLists.txt files #12560

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 25 commits into from
Jul 18, 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
33 changes: 14 additions & 19 deletions devtools/bundled_program/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

set(
_schema_files
bundled_program_schema.fbs
scalar_type.fbs
)
set(_schema_files bundled_program_schema.fbs scalar_type.fbs)

set(_schema_outputs)
foreach(schema_file ${_schema_files})
list(APPEND _bundled_program_schema__srcs "${CMAKE_CURRENT_SOURCE_DIR}/schema/${schema_file}")
list(APPEND _bundled_program_schema__srcs
"${CMAKE_CURRENT_SOURCE_DIR}/schema/${schema_file}"
)

string(REGEX REPLACE "[.]fbs$" "_generated.h" generated "${schema_file}")
list(APPEND _schema_outputs "${DEVTOOLS_INCLUDE_DIR}/executorch/devtools/bundled_program/schema/${generated}")
list(
APPEND
_schema_outputs
"${DEVTOOLS_INCLUDE_DIR}/executorch/devtools/bundled_program/schema/${generated}"
)
endforeach()

file(MAKE_DIRECTORY ${DEVTOOLS_INCLUDE_DIR}/executorch/devtools/bundled_program)
Expand All @@ -32,20 +34,13 @@ add_custom_command(
)

add_library(
bundled_program
${_schema_outputs}
${CMAKE_CURRENT_SOURCE_DIR}/bundled_program.cpp
)
target_link_libraries(
bundled_program
PUBLIC
executorch
bundled_program ${_schema_outputs}
${CMAKE_CURRENT_SOURCE_DIR}/bundled_program.cpp
)
target_link_libraries(bundled_program PUBLIC executorch)
target_include_directories(
bundled_program
PUBLIC
${DEVTOOLS_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/third-party/flatbuffers/include
bundled_program PUBLIC ${DEVTOOLS_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/third-party/flatbuffers/include
)

install(
Expand Down
15 changes: 8 additions & 7 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ endif()
# size_test_all_optimized_ops: binary with optimized ops and no delegate backend
#
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
add_executable(size_test_all_optimized_ops ${_size_test__srcs})
target_link_options_shared_lib(optimized_native_cpu_ops_lib)
target_link_libraries(
size_test_all_optimized_ops executorch optimized_native_cpu_ops_lib)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_options_gc_sections(size_test_all_optimized_ops)
endif()
add_executable(size_test_all_optimized_ops ${_size_test__srcs})
target_link_options_shared_lib(optimized_native_cpu_ops_lib)
target_link_libraries(
size_test_all_optimized_ops executorch optimized_native_cpu_ops_lib
)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_options_gc_sections(size_test_all_optimized_ops)
endif()
endif()
16 changes: 8 additions & 8 deletions tools/cmake/executorch-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ if(TARGET coremldelegate)
endif()

if(TARGET etdump)
set_target_properties(etdump PROPERTIES INTERFACE_LINK_LIBRARIES "flatccrt;executorch")
set_target_properties(
etdump PROPERTIES INTERFACE_LINK_LIBRARIES "flatccrt;executorch"
)
endif()

if(TARGET optimized_native_cpu_ops_lib)
Expand All @@ -174,13 +176,11 @@ if(TARGET extension_threadpool)
endif()

set(shared_lib_list
# executorch -- size tests fail due to regression if we include this and I'm not sure it's needed.
optimized_native_cpu_ops_lib
portable_ops_lib
quantized_ops_lib
xnnpack_backend
vulkan_backend
quantized_ops_aot_lib)
# executorch -- size tests fail due to regression if we include this and I'm
# not sure it's needed.
optimized_native_cpu_ops_lib portable_ops_lib quantized_ops_lib
xnnpack_backend vulkan_backend quantized_ops_aot_lib
)
foreach(lib ${shared_lib_list})
if(TARGET ${lib})
target_link_options_shared_lib(${lib})
Expand Down
Loading
Loading