Skip to content

Sweep major CMake files for use of include/lib instead of CMAKE_INSTALL_INCLUDE/LIBDIR #12792

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

Open
wants to merge 127 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
6d51bff
Update
swolchok Mar 5, 2025
9e3e2e7
Update
swolchok Jul 13, 2025
16f0274
forgot to amend
swolchok Jul 13, 2025
99ec5a7
Update
swolchok Jul 14, 2025
ff3cdb9
Update
swolchok Jul 14, 2025
513de13
Update
swolchok Jul 14, 2025
76db1f1
Update
swolchok Jul 14, 2025
08bffac
Update
swolchok Jul 14, 2025
dff96c8
Update
swolchok Jul 14, 2025
0e2bce6
Update
swolchok Jul 14, 2025
35d8319
Update
swolchok Jul 14, 2025
b87d2fb
Update
swolchok Jul 14, 2025
a31187e
Update
swolchok Jul 15, 2025
dcbce0d
Update
swolchok Jul 15, 2025
bc8f971
Update
swolchok Jul 15, 2025
29d3999
Update
swolchok Jul 15, 2025
7e4040a
Update
swolchok Jul 15, 2025
2dacf6f
Update
swolchok Jul 15, 2025
497ea70
Update
swolchok Jul 15, 2025
fb2b775
Update
swolchok Jul 15, 2025
02f19a6
Update
swolchok Jul 15, 2025
225d5a6
Update
swolchok Jul 15, 2025
f8d2baf
Update
swolchok Jul 15, 2025
41bf264
Update
swolchok Jul 16, 2025
f54a8ce
Update
swolchok Jul 16, 2025
e48e6cc
Update
swolchok Jul 16, 2025
62658a6
Update
swolchok Jul 16, 2025
a2f14ac
Update
swolchok Jul 16, 2025
46e9698
stack on #12566
swolchok Jul 16, 2025
4ac87e3
Update
swolchok Jul 17, 2025
0c7f574
Update
swolchok Jul 17, 2025
200b7dd
Update
swolchok Jul 17, 2025
b85ed41
Update
swolchok Jul 17, 2025
c31a4b9
Update
swolchok Jul 17, 2025
4fd7372
Update
swolchok Jul 17, 2025
d650396
Update
swolchok Jul 17, 2025
3bfdade
Update
swolchok Jul 17, 2025
00acd77
Update
swolchok Jul 17, 2025
6946143
Update
swolchok Jul 17, 2025
431ddd8
Update
swolchok Jul 17, 2025
60456ca
Update
swolchok Jul 17, 2025
5f121b7
Update
swolchok Jul 17, 2025
dcb3ca0
Update
swolchok Jul 18, 2025
3c30b31
Update
swolchok Jul 18, 2025
e9928a7
Update
swolchok Jul 18, 2025
b57678b
Update
swolchok Jul 18, 2025
b0094c1
Update
swolchok Jul 18, 2025
05effc4
Update
swolchok Jul 18, 2025
f5bcdcc
Update
swolchok Jul 18, 2025
2556e9a
Update
swolchok Jul 18, 2025
9a5096c
Update
swolchok Jul 19, 2025
2e21d9a
Update
swolchok Jul 19, 2025
63e4a27
Update
swolchok Jul 19, 2025
d9517d8
Update
swolchok Jul 19, 2025
4c2e046
rebase
swolchok Jul 19, 2025
0eb3d8d
rebase
swolchok Jul 19, 2025
a451cc3
rebase
swolchok Jul 19, 2025
92548b6
rebase
swolchok Jul 19, 2025
0d164ce
Update
swolchok Jul 21, 2025
2e1d1e4
Update
swolchok Jul 21, 2025
5d15809
fix unittest, bump size test threshold to account for op registration…
swolchok Jul 21, 2025
980279b
Update
swolchok Jul 21, 2025
ccd0e2d
Update
swolchok Jul 21, 2025
f9b96eb
Update
swolchok Jul 21, 2025
02d6d67
Update
swolchok Jul 21, 2025
dd18bfe
Update
swolchok Jul 21, 2025
5be4b7b
Update
swolchok Jul 21, 2025
bf1a6cd
Update
swolchok Jul 21, 2025
719bb4f
Update
swolchok Jul 21, 2025
ba9f19e
Update
swolchok Jul 21, 2025
a342614
Update
swolchok Jul 21, 2025
d451e7c
Update
swolchok Jul 21, 2025
91fe6ad
Update
swolchok Jul 21, 2025
d0f93f7
Update
swolchok Jul 21, 2025
9e9373a
Update
swolchok Jul 21, 2025
16b02c0
Update
swolchok Jul 21, 2025
8627bbb
Update
swolchok Jul 22, 2025
5b7415a
Update
swolchok Jul 22, 2025
8af5beb
Update
swolchok Jul 22, 2025
995f6fa
Update
swolchok Jul 22, 2025
d2ee588
Update
swolchok Jul 22, 2025
853a128
Update
swolchok Jul 22, 2025
0ffc394
Update
swolchok Jul 22, 2025
2c62f9b
Update
swolchok Jul 22, 2025
a06c916
Merge branch 'main' into gh/swolchok/517/head
swolchok Jul 22, 2025
3d760e0
Update
swolchok Jul 22, 2025
ae4ac22
Update
swolchok Jul 22, 2025
9e04e6a
Update
swolchok Jul 22, 2025
fa557ca
Update
swolchok Jul 22, 2025
098f4ad
Update
swolchok Jul 22, 2025
5173bf2
Update
swolchok Jul 23, 2025
e6c83db
Update
swolchok Jul 23, 2025
8978c19
Update
swolchok Jul 23, 2025
783c39d
Update
swolchok Jul 23, 2025
08d9f80
Update
swolchok Jul 23, 2025
5eaa349
Update
swolchok Jul 23, 2025
1cf3567
Update
swolchok Jul 23, 2025
b0d965c
Update
swolchok Jul 23, 2025
d9bf112
Update
swolchok Jul 23, 2025
98ebc97
Update
swolchok Jul 23, 2025
387e8d8
Update
swolchok Jul 23, 2025
313ccaf
Update
swolchok Jul 23, 2025
7852f9a
Update
swolchok Jul 23, 2025
5f9f7c5
Update
swolchok Jul 23, 2025
bdabc9c
Update
swolchok Jul 23, 2025
98cb422
Update
swolchok Jul 23, 2025
ee010ee
Update
swolchok Jul 23, 2025
029ce6b
Update
swolchok Jul 23, 2025
ef42dd0
forgot to restore tokenizers bump. format a CMake file
swolchok Jul 23, 2025
a9dadf4
Update
swolchok Jul 23, 2025
707e40f
Update
swolchok Jul 23, 2025
3d04265
Update
swolchok Jul 23, 2025
388d4ba
Update
swolchok Jul 23, 2025
5596d52
Update
swolchok Jul 23, 2025
e0183db
fix zephyr size test to build data_loader extension. might be the las…
swolchok Jul 23, 2025
5efa8e7
fix zephyr size test to build data_loader extension. might be the las…
swolchok Jul 23, 2025
1029ce3
fix zephyr size test to build data_loader extension. might be the las…
swolchok Jul 23, 2025
a82dc25
Update
swolchok Jul 23, 2025
c560ee1
move zephyr fix to bottom PR where it belongs
swolchok Jul 24, 2025
a436fbe
move zephyr fix to bottom PR where it belongs
swolchok Jul 24, 2025
5391854
move zephyr fix to bottom PR where it belongs
swolchok Jul 24, 2025
0e7a016
bump arm baremetal size test thresholds again for EXPORT diff
swolchok Jul 24, 2025
2df7d5f
bump arm baremetal size test thresholds again for EXPORT diff
swolchok Jul 24, 2025
ecc92b1
fix incorrect QNN conflict resolution on last rebase
swolchok Jul 24, 2025
862c9fc
fix incorrect QNN conflict resolution on last rebase
swolchok Jul 24, 2025
db7c3cd
Update
swolchok Jul 25, 2025
abb4148
Update
swolchok Jul 25, 2025
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
2 changes: 2 additions & 0 deletions .ci/scripts/build-qnn-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ set_up_aot() {
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_EXTENSION_EXTENSION_LLM_RUNNER=ON \
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
Expand Down
1 change: 1 addition & 0 deletions .ci/scripts/test_llama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ cmake_install_executorch_libraries() {
echo "Installing libexecutorch.a, libextension_module.so, libportable_ops_lib.a"
rm -rf cmake-out
retry cmake --preset llm \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
-DEXECUTORCH_BUILD_QNN="$QNN" \
Expand Down
2 changes: 2 additions & 0 deletions .ci/scripts/test_llama_torchao_lowbit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ cmake -DPYTHON_EXECUTABLE=python \
-DEXECUTORCH_ENABLE_LOGGING=1 \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
Expand Down
2 changes: 2 additions & 0 deletions .ci/scripts/test_llava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ EXECUTORCH_COMMON_CMAKE_ARGS=" \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
size=${arr[4]}
# threshold=48120 on devserver with gcc11.4
# todo(lfq): update once binary size is below 50kb.
threshold="55584"
threshold="63776"
if [[ "$size" -le "$threshold" ]]; then
echo "Success $size <= $threshold"
else
Expand Down Expand Up @@ -406,7 +406,7 @@ jobs:
output=$(ls -la cmake-out/test/size_test)
arr=($output)
size=${arr[4]}
threshold="51728"
threshold="51744"
if [[ "$size" -le "$threshold" ]]; then
echo "Success $size <= $threshold"
else
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ jobs:
setup_script_args=""
if [[ ${{ matrix.os}} == "bare_metal" ]]; then
toolchain_prefix=arm-none-eabi-
threshold="104000" # should be ~103.7KB, set threshold to 104KB.
threshold="109000"
toolchain_cmake=examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
elif [[ ${{ matrix.os}} == "zephyr-preset" ]]; then
setup_script_args="--target-toolchain zephyr"
toolchain_prefix=arm-zephyr-eabi-
threshold="133120" # should be ~125KB, set threshold to 130KB
threshold="135000"
toolchain_cmake=examples/zephyr/x86_64-linux-arm-zephyr-eabi-gcc.cmake
else
echo "Fail unsupport OS selection ${{ matrix.os }}"
Expand Down
95 changes: 75 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ include(${PROJECT_SOURCE_DIR}/tools/cmake/common/preset.cmake)
include(${PROJECT_SOURCE_DIR}/tools/cmake/Utils.cmake)
include(CMakeDependentOption)
include(ExternalProject)
include(GNUInstallDirs)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -175,6 +176,7 @@ if(NOT DEFINED FXDIV_SOURCE_DIR)
)
set(FXDIV_SOURCE_DIR "backends/xnnpack/third-party/FXdiv")
add_subdirectory("${FXDIV_SOURCE_DIR}")
executorch_move_interface_include_directories_to_build_time_only(fxdiv)
set(CMAKE_POSITION_INDEPENDENT_CODE
${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG}
)
Expand All @@ -186,7 +188,9 @@ if(EXECUTORCH_BUILD_CPUINFO)
${CMAKE_POSITION_INDEPENDENT_CODE}
)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CPUINFO_SOURCE_DIR "backends/xnnpack/third-party/cpuinfo")
set(CPUINFO_SOURCE_DIR
"${CMAKE_CURRENT_LIST_DIR}/backends/xnnpack/third-party/cpuinfo"
)
set(CPUINFO_BUILD_TOOLS
OFF
CACHE BOOL ""
Expand Down Expand Up @@ -216,6 +220,14 @@ if(EXECUTORCH_BUILD_CPUINFO)
set(CMAKE_POSITION_INDEPENDENT_CODE
${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG}
)
executorch_add_prefix_to_public_headers(cpuinfo "${CPUINFO_SOURCE_DIR}/")
install(
TARGETS cpuinfo
EXPORT ExecuTorchTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
DESTINATION ${_common_include_directories}
)
endif()

if(EXECUTORCH_BUILD_PTHREADPOOL)
Expand Down Expand Up @@ -248,6 +260,17 @@ if(EXECUTORCH_BUILD_PTHREADPOOL)
)
endif()
add_subdirectory("${PTHREADPOOL_SOURCE_DIR}")
executorch_move_interface_include_directories_to_build_time_only(pthreadpool)
executorch_move_interface_include_directories_to_build_time_only(
pthreadpool_interface
)
install(
TARGETS pthreadpool pthreadpool_interface fxdiv
EXPORT ExecuTorchTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
DESTINATION ${_common_include_directories}
)
set(CMAKE_POSITION_INDEPENDENT_CODE
${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG}
)
Expand All @@ -271,8 +294,10 @@ if(NOT "${_repo_dir_name}" STREQUAL "executorch")
)
endif()
set(_common_include_directories
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/runtime/core/portable_type/c10
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/runtime/core/portable_type/c10>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/executorch/runtime/core/portable_type/c10>
)

#
Expand Down Expand Up @@ -447,53 +472,54 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/configurations)
# ${CMAKE_INSTALL_PREFIX}/
install(
DIRECTORY runtime/core/
DESTINATION include/executorch/runtime/core
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/runtime/core
FILES_MATCHING
PATTERN "*.h"
)
install(
DIRECTORY runtime/executor/
DESTINATION include/executorch/runtime/executor
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/runtime/executor
FILES_MATCHING
PATTERN "*.h"
)
install(
DIRECTORY runtime/kernel/
DESTINATION include/executorch/runtime/kernel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/runtime/kernel
FILES_MATCHING
PATTERN "*.h"
)
install(
DIRECTORY runtime/platform/
DESTINATION include/executorch/runtime/platform
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/runtime/platform
FILES_MATCHING
PATTERN "*.h"
)
install(
DIRECTORY extension/kernel_util/
DESTINATION include/executorch/extension/kernel_util
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/kernel_util
FILES_MATCHING
PATTERN "*.h"
)
install(
DIRECTORY extension/tensor/
DESTINATION include/executorch/extension/tensor
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/tensor
FILES_MATCHING
PATTERN "*.h"
)
install(
DIRECTORY extension/threadpool/
DESTINATION include/executorch/extension/threadpool
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/threadpool
FILES_MATCHING
PATTERN "*.h"
)
install(
TARGETS executorch executorch_core
EXPORT ExecuTorchTargets
INCLUDES
DESTINATION ${_common_include_directories}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES tools/cmake/Utils.cmake tools/cmake/executorch-config.cmake
DESTINATION lib/cmake/ExecuTorch
install(FILES tools/cmake/executorch-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ExecuTorch
)

if(EXECUTORCH_BUILD_ARM_BAREMETAL)
Expand Down Expand Up @@ -546,6 +572,12 @@ endif()

if(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
install(
DIRECTORY extension/data_loader/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/data_loader
FILES_MATCHING
PATTERN "*.h"
)
endif()

if(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL)
Expand All @@ -566,24 +598,39 @@ if(EXECUTORCH_BUILD_EXTENSION_MODULE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/module)
install(
DIRECTORY extension/module/
DESTINATION include/executorch/extension/module
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/module
FILES_MATCHING
PATTERN "*.h"
)
endif()

if(EXECUTORCH_BUILD_EXTENSION_LLM)
if(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER)
set(SUPPORT_REGEX_LOOKAHEAD ON)
# llama/runner/CMakeLists.txt builds a shared library libllama_runner.so
# that transitively depends on tokenizers. Need to build tokenizers with
# -fPIC.
set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG
${CMAKE_POSITION_INDEPENDENT_CODE}
)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/tokenizers)
endif()

if(EXECUTORCH_BUILD_EXTENSION_LLM_APPLE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/apple)
if(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER)
set(CMAKE_POSITION_INDEPENDENT_CODE
${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG}
)
endif()
endif()

if(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/runner)
endif()

if(EXECUTORCH_BUILD_EXTENSION_LLM_APPLE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/apple)
endif()

if(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/runner_util)
install(
Expand Down Expand Up @@ -689,8 +736,10 @@ if(EXECUTORCH_BUILD_PYBIND)
target_compile_options(portable_lib PUBLIC ${_pybind_compile_options})
target_link_libraries(portable_lib PRIVATE ${_dep_libs})

install(TARGETS portable_lib
LIBRARY DESTINATION executorch/extension/pybindings
install(
TARGETS portable_lib
EXPORT ExecuTorchTargets
LIBRARY DESTINATION executorch/extension/pybindings
)
endif()

Expand Down Expand Up @@ -775,5 +824,11 @@ endif()

include(Test.cmake)

install(
EXPORT ExecuTorchTargets
FILE ExecuTorchTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ExecuTorch
)

# Print all the configs that were called with announce_configured_options.
print_configured_options()
38 changes: 28 additions & 10 deletions backends/apple/coreml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,24 @@ endif()

add_library(coreml_util ${UTIL_SOURCES})
target_include_directories(
coreml_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util
coreml_util
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/runtime/util>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/executorch/backends/apple/coreml/runtime/util>
)
if(APPLE)
target_link_libraries(coreml_util PRIVATE ${FOUNDATION_FRAMEWORK})
endif()
target_compile_options(coreml_util PUBLIC -fPIC)

install(TARGETS coreml_util DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(
TARGETS coreml_util
DESTINATION lib
INCLUDES
DESTINATION ${_common_include_directories}
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/executorch/backends/apple/coreml/runtime/util
FILES_MATCHING
PATTERN "*.h"
)

# CoreML inmemoryfs
Expand All @@ -134,7 +140,10 @@ endif()

add_library(coreml_inmemoryfs ${INMEMORYFS_SOURCES})
target_include_directories(
coreml_inmemoryfs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs
coreml_inmemoryfs
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/executorch/backends/apple/coreml/runtime/inmemoryfs>
)
if(APPLE)
target_link_libraries(
Expand All @@ -145,11 +154,19 @@ target_compile_options(coreml_inmemoryfs PUBLIC -fPIC)

install(
TARGETS coreml_inmemoryfs
DESTINATION lib
DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
DESTINATION ${_common_include_directories}
)

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/executorch/backends/apple/coreml/runtime/inmemoryfs
FILES_MATCHING
PATTERN "*.h"
)

# executorchcoreml

if(EXECUTORCH_BUILD_PYBIND)
Expand Down Expand Up @@ -232,9 +249,10 @@ if(APPLE)
endif()

install(
TARGETS coremldelegate
DESTINATION lib
TARGETS coremldelegate coreml_util coreml_inmemoryfs
EXPORT ExecuTorchTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
DESTINATION ${_common_include_directories}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
13 changes: 7 additions & 6 deletions backends/apple/mps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ endif()
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)

set(_common_compile_options -Wno-deprecated-declarations)
set(_common_include_directories ${EXECUTORCH_ROOT}/..)

set(_mps_schema__include_dir "${CMAKE_BINARY_DIR}/schema/include")

Expand Down Expand Up @@ -51,9 +50,10 @@ add_library(mps_schema INTERFACE ${_mps_schema__outputs})
set_target_properties(mps_schema PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(
mps_schema
INTERFACE ${_mps_schema__include_dir}
${EXECUTORCH_ROOT}/third-party/flatbuffers/include
${_common_include_directories}
INTERFACE
$<BUILD_INTERFACE:${_mps_schema__include_dir}>
$<BUILD_INTERFACE:${EXECUTORCH_ROOT}/third-party/flatbuffers/include>
${_common_include_directories}
)

list(TRANSFORM _mps_backend__srcs PREPEND "${EXECUTORCH_ROOT}/")
Expand All @@ -75,8 +75,9 @@ target_compile_options(mpsdelegate PUBLIC ${_common_compile_options})
target_compile_options(mpsdelegate PRIVATE "-fno-objc-arc")

install(
TARGETS mpsdelegate
DESTINATION lib
TARGETS mpsdelegate mps_schema
EXPORT ExecuTorchTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
DESTINATION ${_common_include_directories}
)
Loading
Loading