Skip to content

Commit b8f66f9

Browse files
authored
cmake-format executorch-config.cmake (#9015)
1 parent 88b49a3 commit b8f66f9

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

build/executorch-config.cmake

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright (c) Meta Platforms, Inc. and affiliates.
32
# All rights reserved.
43
#
@@ -16,20 +15,23 @@
1615
#
1716
# This will define the following variables:
1817
#
19-
# EXECUTORCH_FOUND -- True if the system has the ExecuTorch library
20-
# EXECUTORCH_INCLUDE_DIRS -- The include directories for ExecuTorch
21-
# EXECUTORCH_LIBRARIES -- Libraries to link against
18+
# EXECUTORCH_FOUND -- True if the system has the ExecuTorch library
19+
# EXECUTORCH_INCLUDE_DIRS -- The include directories for ExecuTorch
20+
# EXECUTORCH_LIBRARIES -- Libraries to link against
2221
#
23-
# The actual values for these variables will be different from what executorch-config.cmake
24-
# in executorch pip package gives, but we wanted to keep the contract of exposing these
25-
# CMake variables.
22+
# The actual values for these variables will be different from what
23+
# executorch-config.cmake in executorch pip package gives, but we wanted to keep
24+
# the contract of exposing these CMake variables.
2625

2726
cmake_minimum_required(VERSION 3.19)
2827

2928
set(_root "${CMAKE_CURRENT_LIST_DIR}/../../..")
3029
set(required_lib_list executorch executorch_core portable_kernels)
3130
set(EXECUTORCH_LIBRARIES)
32-
set(EXECUTORCH_INCLUDE_DIRS ${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10 ${_root}/lib)
31+
set(EXECUTORCH_INCLUDE_DIRS
32+
${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10
33+
${_root}/lib
34+
)
3335
foreach(lib ${required_lib_list})
3436
set(lib_var "LIB_${lib}")
3537
add_library(${lib} STATIC IMPORTED)
@@ -40,7 +42,12 @@ foreach(lib ${required_lib_list})
4042
)
4143
set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION "${${lib_var}}")
4244
target_compile_definitions(${lib} INTERFACE C10_USING_CUSTOM_GENERATED_MACROS)
43-
target_include_directories(${lib} INTERFACE ${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10 ${_root}/lib)
45+
target_include_directories(
46+
${lib}
47+
INTERFACE ${_root}/include
48+
${_root}/include/executorch/runtime/core/portable_type/c10
49+
${_root}/lib
50+
)
4451
list(APPEND EXECUTORCH_LIBRARIES ${lib})
4552
endforeach()
4653

@@ -112,7 +119,12 @@ foreach(lib ${lib_list})
112119
add_library(${lib} STATIC IMPORTED)
113120
endif()
114121
set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION "${${lib_var}}")
115-
target_include_directories(${lib} INTERFACE ${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10 ${_root}/lib)
122+
target_include_directories(
123+
${lib}
124+
INTERFACE ${_root}/include
125+
${_root}/include/executorch/runtime/core/portable_type/c10
126+
${_root}/lib
127+
)
116128
list(APPEND EXECUTORCH_LIBRARIES ${lib})
117129
endif()
118130
endforeach()

0 commit comments

Comments
 (0)