Skip to content
Closed
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
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,24 +114,24 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
# Instead please use `find_package(executorch REQUIRED)` in the example
# directory and add a new executable in the example `CMakeLists.txt`.

# Store compile definitions to apply to core targets
set(_executorch_core_compile_definitions)

if(NOT EXECUTORCH_ENABLE_LOGGING)
# Avoid pulling in the logging strings, which can be large. Note that this
# will set the compiler flag for all targets in this directory, and for all
# subdirectories included after this point.
add_definitions(-DET_LOG_ENABLED=0)
# Avoid pulling in the logging strings, which can be large.
list(APPEND _executorch_core_compile_definitions ET_LOG_ENABLED=0)
endif()

add_definitions(-DET_MIN_LOG_LEVEL=${ET_MIN_LOG_LEVEL})
list(APPEND _executorch_core_compile_definitions ET_MIN_LOG_LEVEL=${ET_MIN_LOG_LEVEL})

if(NOT EXECUTORCH_ENABLE_PROGRAM_VERIFICATION)
# Avoid pulling in the flatbuffer data verification logic, which can add about
# 20kB. Note that this will set the compiler flag for all targets in this
# directory, and for all subdirectories included after this point.
add_definitions(-DET_ENABLE_PROGRAM_VERIFICATION=0)
# 20kB.
list(APPEND _executorch_core_compile_definitions ET_ENABLE_PROGRAM_VERIFICATION=0)
endif()

if(EXECUTORCH_ENABLE_EVENT_TRACER)
add_definitions(-DET_EVENT_TRACER_ENABLED)
list(APPEND _executorch_core_compile_definitions ET_EVENT_TRACER_ENABLED)
endif()

# -ffunction-sections -fdata-sections: breaks function and data into sections so
Expand Down Expand Up @@ -358,7 +358,10 @@ target_include_directories(
executorch_core PUBLIC ${_common_include_directories}
)
target_compile_definitions(
executorch_core PUBLIC C10_USING_CUSTOM_GENERATED_MACROS
executorch_core
PUBLIC
C10_USING_CUSTOM_GENERATED_MACROS
${_executorch_core_compile_definitions}
)
target_compile_options(executorch_core PUBLIC ${_common_compile_options})
if(MAX_KERNEL_NUM)
Expand Down Expand Up @@ -401,7 +404,12 @@ endif()
add_library(executorch ${_executorch__srcs})
target_link_libraries(executorch PRIVATE executorch_core)
target_include_directories(executorch PUBLIC ${_common_include_directories})
target_compile_definitions(executorch PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
target_compile_definitions(
executorch
PUBLIC
C10_USING_CUSTOM_GENERATED_MACROS
${_executorch_core_compile_definitions}
)
target_compile_options(executorch PUBLIC ${_common_compile_options})
target_link_options_shared_lib(executorch)

Expand Down
2 changes: 1 addition & 1 deletion backends/apple/mps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# LICENSE file in the top level directory.
#

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Expand Down
9 changes: 6 additions & 3 deletions backends/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
project(arm_backend)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand All @@ -15,12 +15,12 @@ endif()
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)

set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10)
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
# C10_USING_CUSTOM_GENERATED_MACROS will be set on executorch_delegate_ethos_u target

# Third-party folder and Ethos-U driver inclued
set(THIRD_PARTY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
set(DRIVER_ETHOSU_INCLUDE_DIR "${THIRD_PARTY_ROOT}/ethos-u-core-driver/include")
include_directories(${DRIVER_ETHOSU_INCLUDE_DIR})
# DRIVER_ETHOSU_INCLUDE_DIR is added to executorch_delegate_ethos_u target via target_include_directories

set(_arm_baremetal_sources backends/arm/runtime/EthosUBackend.cpp
backends/arm/runtime/VelaBinStream.cpp
Expand All @@ -34,3 +34,6 @@ target_include_directories(
target_include_directories(
executorch_delegate_ethos_u PUBLIC ${DRIVER_ETHOSU_INCLUDE_DIR}
)
target_compile_definitions(
executorch_delegate_ethos_u PUBLIC C10_USING_CUSTOM_GENERATED_MACROS
)
2 changes: 1 addition & 1 deletion backends/cadence/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.

# Set the minimum required version of CMake for this project.
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.24)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/fusion_g3/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.24)
project(cadence_nnlib)

add_custom_target(
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/hifi/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/hifi/third-party/nnlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.24)
project(cadence_nnlib)

add_custom_target(
Expand Down
2 changes: 1 addition & 1 deletion backends/cadence/reference/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
Expand Down
2 changes: 1 addition & 1 deletion backends/cortex_m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ~~~
# cmake-format -i CMakeLists.txt
# ~~~
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
Expand Down
12 changes: 8 additions & 4 deletions backends/mediatek/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ if(EXECUTORCH_BUILD_NEURON_BUFFER_ALLOCATOR)
add_subdirectory(runtime/proprietary)
endif()

include_directories(BEFORE ${_common_include_directories})

# shortcut include directory for neuron headers
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include)
# Include directories will be set on neuron_backend target below

# targets
add_library(neuron_backend SHARED)
Expand All @@ -42,6 +39,13 @@ target_sources(
${CMAKE_CURRENT_LIST_DIR}/runtime/NeuronExecutor.cpp
${CMAKE_CURRENT_LIST_DIR}/runtime/NeuronBufferAllocator.cpp
)

# Set include directories for neuron_backend target
target_include_directories(neuron_backend
PRIVATE
${_common_include_directories}
${CMAKE_CURRENT_SOURCE_DIR}/runtime/include
)
target_link_options_shared_lib(neuron_backend)

install(TARGETS neuron_backend DESTINATION lib)
2 changes: 1 addition & 1 deletion backends/openvino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.

# Set minimum required CMake version
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

# Set project name
project(openvino_backend_project)
Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# The targets in this file will be built if EXECUTORCH_BUILD_VULKAN is ON

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

if(NOT EXECUTORCH_ROOT)
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# The targets in this file will be built if EXECUTORCH_BUILD_VULKAN is ON

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
project(executorch)

if(ANDROID)
Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/test/op_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# The targets in this file will be built if EXECUTORCH_BUILD_VULKAN is ON

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
project(executorch)

if(ANDROID)
Expand Down
10 changes: 7 additions & 3 deletions backends/xnnpack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ endif()

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)

# Store XNNPACK-specific compile definitions
set(_xnnpack_compile_definitions)

if(EXECUTORCH_XNNPACK_ENABLE_WEIGHT_CACHE)
add_definitions(-DENABLE_XNNPACK_WEIGHTS_CACHE)
list(APPEND _xnnpack_compile_definitions ENABLE_XNNPACK_WEIGHTS_CACHE)
endif()
if(EXECUTORCH_XNNPACK_SHARED_WORKSPACE)
add_definitions(-DENABLE_XNNPACK_SHARED_WORKSPACE)
list(APPEND _xnnpack_compile_definitions ENABLE_XNNPACK_SHARED_WORKSPACE)
endif()
if(EXECUTORCH_XNNPACK_ENABLE_KLEIDI)
add_definitions(-DENABLE_XNNPACK_KLEIDI)
list(APPEND _xnnpack_compile_definitions ENABLE_XNNPACK_KLEIDI)
endif()

set(_common_include_directories ${EXECUTORCH_ROOT}/..)
Expand Down Expand Up @@ -116,6 +119,7 @@ target_include_directories(
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/third-party/cpuinfo/include
)
target_compile_options(xnnpack_backend PUBLIC ${_common_compile_options})
target_compile_definitions(xnnpack_backend PRIVATE ${_xnnpack_compile_definitions})
target_link_options_shared_lib(xnnpack_backend)

install(
Expand Down
2 changes: 1 addition & 1 deletion backends/xnnpack/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ set(XNNPACK_BUILD_ALL_MICROKERNELS
CACHE BOOL ""
)
add_subdirectory("${XNNPACK_SOURCE_DIR}")
include_directories(SYSTEM ${XNNPACK_INCLUDE_DIR})
# XNNPACK_INCLUDE_DIR is added to xnnpack_backend target via target_include_directories
list(APPEND xnnpack_third_party XNNPACK)
install(TARGETS microkernels-prod
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
2 changes: 1 addition & 1 deletion backends/xnnpack/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# It should also be cmake-lint clean.
#

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

Expand Down
2 changes: 1 addition & 1 deletion configurations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_CXX_STANDARD)
Expand Down
2 changes: 1 addition & 1 deletion devtools/etdump/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# It should also be cmake-lint clean.
#

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

Expand Down
6 changes: 3 additions & 3 deletions examples/apple/mps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# MPSBackend.
#

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)

project(mps_runner_example)

Expand All @@ -29,7 +29,7 @@ if(NOT PYTHON_EXECUTABLE)
resolve_python_executable()
endif()

add_compile_options("-Wall" "-Werror")
# Compile options will be set on mps_executor_runner target

include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)

Expand Down Expand Up @@ -112,5 +112,5 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
mps_portable_ops_lib
${mps_executor_runner_libs}
)
target_compile_options(mps_executor_runner PUBLIC ${_common_compile_options})
target_compile_options(mps_executor_runner PUBLIC ${_common_compile_options} -Wall -Werror)
endif()
2 changes: 1 addition & 1 deletion examples/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# cmake-format -i CMakeLists.txt
# ~~~

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
project(arm_example)

# Option to register op list
Expand Down
2 changes: 1 addition & 1 deletion examples/arm/executor_runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.24)
project(arm_executor_runner)

option(SEMIHOSTING "Enable semihosting" OFF)
Expand Down
2 changes: 1 addition & 1 deletion examples/cadence/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.

# Set the minimum required version of CMake for this project.
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.24)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
Expand Down
2 changes: 1 addition & 1 deletion examples/devtools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Example CMakeLists.txt for building executor_runner with Developer Tools
# support. In this example we link devtools and bundled_program libraries into
# executor_runner binary
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
project(devtools_example)

option(EXECUTORCH_BUILD_COREML "Build the Core ML backend" OFF)
Expand Down
2 changes: 1 addition & 1 deletion examples/llm_manual/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
project(nanogpt_runner)

set(CMAKE_CXX_STANDARD 17)
Expand Down
Loading
Loading