Skip to content

Commit 848b8bd

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Patch cmake build on mac
Summary: 1. bump cmake minimum version to 3.19 so that we can use `add_library INTERFACE {sources}` 2. add `-force_load` for `clang_kernel_link_options` so it can force load kernel library. Reviewed By: kimishpatel, dbort Differential Revision: D48328846 fbshipit-source-id: 1713619a426e23e7938a2872e64189fe53f2e333
1 parent c351717 commit 848b8bd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# It should also be cmake-lint clean.
4141
#
4242

43-
cmake_minimum_required(VERSION 3.13)
43+
cmake_minimum_required(VERSION 3.19)
4444
project(executorch)
4545
include(build/Utils.cmake)
4646

@@ -152,7 +152,7 @@ add_custom_command(
152152
COMMENT "Generating program_schema headers"
153153
VERBATIM)
154154

155-
add_library(program_schema ${_program_schema__outputs})
155+
add_library(program_schema INTERFACE ${_program_schema__outputs})
156156
set_target_properties(program_schema PROPERTIES LINKER_LANGUAGE CXX)
157157
target_include_directories(
158158
program_schema

build/Utils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function(clang_kernel_link_options target_name)
3030
# for targets that depend on this library; once because CMake will add
3131
# it, and once because it's in this list of args. See if there's a way
3232
# to avoid that.
33-
-Wl,$<TARGET_FILE:${target_name}>
33+
-Wl,-force_load,$<TARGET_FILE:${target_name}>
3434
)
3535
endfunction()
3636

docs/website/docs/tutorials/cmake_build_system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ useful to embedded systems users.
4141
install` inside your conda environment if you created one during AOT Setup
4242
(see [Setting up
4343
Executorch](00_setting_up_executorch.md#aot-setup-open-on-google-colab)).
44-
1. Install CMake version 3.13 or later
44+
1. Install CMake version 3.19 or later
4545

4646
## Configure the CMake build
4747

examples/custom_ops/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# both binding wrapper and the implementation source file. This library can be
1414
# linked into Executorch binary (`executor_runner` in this example) and it is
1515
# ready to run models containing that custom op.
16-
cmake_minimum_required(VERSION 3.13)
16+
cmake_minimum_required(VERSION 3.19)
1717

1818
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1919
if(NOT CMAKE_CXX_STANDARD)

0 commit comments

Comments
 (0)