diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a3b1f7bfe0..90d669f0d5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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) @@ -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) diff --git a/backends/apple/mps/CMakeLists.txt b/backends/apple/mps/CMakeLists.txt index 7822afdef46..53f3361b0e0 100644 --- a/backends/apple/mps/CMakeLists.txt +++ b/backends/apple/mps/CMakeLists.txt @@ -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) diff --git a/backends/arm/CMakeLists.txt b/backends/arm/CMakeLists.txt index 39a51c56b14..3699b4b3904 100644 --- a/backends/arm/CMakeLists.txt +++ b/backends/arm/CMakeLists.txt @@ -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) @@ -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 @@ -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 +) diff --git a/backends/cadence/CMakeLists.txt b/backends/cadence/CMakeLists.txt index 17c88af8e11..f96b5ef202a 100644 --- a/backends/cadence/CMakeLists.txt +++ b/backends/cadence/CMakeLists.txt @@ -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) diff --git a/backends/cadence/fusion_g3/operators/CMakeLists.txt b/backends/cadence/fusion_g3/operators/CMakeLists.txt index c29ffa91af9..73982b5ac08 100644 --- a/backends/cadence/fusion_g3/operators/CMakeLists.txt +++ b/backends/cadence/fusion_g3/operators/CMakeLists.txt @@ -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) diff --git a/backends/cadence/fusion_g3/third-party/nnlib/CMakeLists.txt b/backends/cadence/fusion_g3/third-party/nnlib/CMakeLists.txt index a2615e08510..0b7593a10e7 100644 --- a/backends/cadence/fusion_g3/third-party/nnlib/CMakeLists.txt +++ b/backends/cadence/fusion_g3/third-party/nnlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10.0) +cmake_minimum_required(VERSION 3.24) project(cadence_nnlib) add_custom_target( diff --git a/backends/cadence/hifi/operators/CMakeLists.txt b/backends/cadence/hifi/operators/CMakeLists.txt index 92432cdc24c..1b3122109b2 100644 --- a/backends/cadence/hifi/operators/CMakeLists.txt +++ b/backends/cadence/hifi/operators/CMakeLists.txt @@ -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) diff --git a/backends/cadence/hifi/third-party/nnlib/CMakeLists.txt b/backends/cadence/hifi/third-party/nnlib/CMakeLists.txt index 90eca6b47e1..0f3e3ab607e 100644 --- a/backends/cadence/hifi/third-party/nnlib/CMakeLists.txt +++ b/backends/cadence/hifi/third-party/nnlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10.0) +cmake_minimum_required(VERSION 3.24) project(cadence_nnlib) add_custom_target( diff --git a/backends/cadence/reference/operators/CMakeLists.txt b/backends/cadence/reference/operators/CMakeLists.txt index 6a71af012e4..d238c50d090 100644 --- a/backends/cadence/reference/operators/CMakeLists.txt +++ b/backends/cadence/reference/operators/CMakeLists.txt @@ -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) diff --git a/backends/cortex_m/CMakeLists.txt b/backends/cortex_m/CMakeLists.txt index 5c353389d94..9362b279a05 100644 --- a/backends/cortex_m/CMakeLists.txt +++ b/backends/cortex_m/CMakeLists.txt @@ -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) diff --git a/backends/mediatek/CMakeLists.txt b/backends/mediatek/CMakeLists.txt index 371e042f6ab..2f6f9702a6b 100644 --- a/backends/mediatek/CMakeLists.txt +++ b/backends/mediatek/CMakeLists.txt @@ -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) @@ -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) diff --git a/backends/openvino/CMakeLists.txt b/backends/openvino/CMakeLists.txt index 8d07cd9a366..0f153b1ae90 100644 --- a/backends/openvino/CMakeLists.txt +++ b/backends/openvino/CMakeLists.txt @@ -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) diff --git a/backends/vulkan/CMakeLists.txt b/backends/vulkan/CMakeLists.txt index db7c3694f28..ad713d11bc3 100644 --- a/backends/vulkan/CMakeLists.txt +++ b/backends/vulkan/CMakeLists.txt @@ -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}/../..) diff --git a/backends/vulkan/test/CMakeLists.txt b/backends/vulkan/test/CMakeLists.txt index 0b3f22875ad..051f67c98de 100644 --- a/backends/vulkan/test/CMakeLists.txt +++ b/backends/vulkan/test/CMakeLists.txt @@ -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) diff --git a/backends/vulkan/test/op_tests/CMakeLists.txt b/backends/vulkan/test/op_tests/CMakeLists.txt index 59baafe3cef..8fc8d818a4e 100644 --- a/backends/vulkan/test/op_tests/CMakeLists.txt +++ b/backends/vulkan/test/op_tests/CMakeLists.txt @@ -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) diff --git a/backends/xnnpack/CMakeLists.txt b/backends/xnnpack/CMakeLists.txt index b6ba211ecb3..408f06e8612 100644 --- a/backends/xnnpack/CMakeLists.txt +++ b/backends/xnnpack/CMakeLists.txt @@ -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}/..) @@ -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( diff --git a/backends/xnnpack/cmake/Dependencies.cmake b/backends/xnnpack/cmake/Dependencies.cmake index 64d2409fb61..4cfe78f016a 100644 --- a/backends/xnnpack/cmake/Dependencies.cmake +++ b/backends/xnnpack/cmake/Dependencies.cmake @@ -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} diff --git a/backends/xnnpack/test/CMakeLists.txt b/backends/xnnpack/test/CMakeLists.txt index c73709817f2..d2254e7c291 100644 --- a/backends/xnnpack/test/CMakeLists.txt +++ b/backends/xnnpack/test/CMakeLists.txt @@ -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}/../../..) diff --git a/configurations/CMakeLists.txt b/configurations/CMakeLists.txt index c039d1a8e05..0206d13af7e 100644 --- a/configurations/CMakeLists.txt +++ b/configurations/CMakeLists.txt @@ -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) diff --git a/devtools/etdump/tests/CMakeLists.txt b/devtools/etdump/tests/CMakeLists.txt index 1443457932e..cacc2ceb050 100644 --- a/devtools/etdump/tests/CMakeLists.txt +++ b/devtools/etdump/tests/CMakeLists.txt @@ -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}/../../..) diff --git a/examples/apple/mps/CMakeLists.txt b/examples/apple/mps/CMakeLists.txt index 9bad0b4b206..4a2d46bd180 100644 --- a/examples/apple/mps/CMakeLists.txt +++ b/examples/apple/mps/CMakeLists.txt @@ -8,7 +8,7 @@ # MPSBackend. # -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(mps_runner_example) @@ -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) @@ -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() diff --git a/examples/arm/CMakeLists.txt b/examples/arm/CMakeLists.txt index 4bae20d2c1f..e92ef1d9162 100644 --- a/examples/arm/CMakeLists.txt +++ b/examples/arm/CMakeLists.txt @@ -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 diff --git a/examples/arm/executor_runner/CMakeLists.txt b/examples/arm/executor_runner/CMakeLists.txt index b3bae768996..59c8dabbe58 100644 --- a/examples/arm/executor_runner/CMakeLists.txt +++ b/examples/arm/executor_runner/CMakeLists.txt @@ -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) diff --git a/examples/cadence/CMakeLists.txt b/examples/cadence/CMakeLists.txt index 757009bd4df..078f3542ea0 100644 --- a/examples/cadence/CMakeLists.txt +++ b/examples/cadence/CMakeLists.txt @@ -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) diff --git a/examples/devtools/CMakeLists.txt b/examples/devtools/CMakeLists.txt index 74cbf5e78e6..31bc7169fdc 100644 --- a/examples/devtools/CMakeLists.txt +++ b/examples/devtools/CMakeLists.txt @@ -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) diff --git a/examples/llm_manual/CMakeLists.txt b/examples/llm_manual/CMakeLists.txt index 1283eb548ea..b0acab8fca1 100644 --- a/examples/llm_manual/CMakeLists.txt +++ b/examples/llm_manual/CMakeLists.txt @@ -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) diff --git a/examples/mediatek/CMakeLists.txt b/examples/mediatek/CMakeLists.txt index 1a6a5369a13..285254ca529 100644 --- a/examples/mediatek/CMakeLists.txt +++ b/examples/mediatek/CMakeLists.txt @@ -4,7 +4,7 @@ # except in compliance with the License. See the license file in the root # directory of this source tree for more details. -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(mediatek_example) message(CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}) @@ -46,7 +46,7 @@ find_package(executorch CONFIG REQUIRED) target_compile_options(executorch INTERFACE -DET_EVENT_TRACER_ENABLED) find_package(gflags REQUIRED) -link_directories(${EXECUTORCH_ROOT}/cmake-android-out/lib) +# Link directories will be set on individual executable targets if(${ANDROID}) message("Build MTK Android Examples") @@ -74,6 +74,7 @@ if(${ANDROID}) gflags ) target_compile_options(mtk_executor_runner PUBLIC ${_common_compile_options}) + target_link_directories(mtk_executor_runner PRIVATE ${EXECUTORCH_ROOT}/cmake-android-out/lib) set(_mtk_oss_executor_runner__srcs ${_executor_runner__srcs}) list( @@ -112,6 +113,7 @@ if(${ANDROID}) PUBLIC ${_common_compile_options} ) + target_link_directories(mtk_oss_executor_runner PRIVATE ${EXECUTORCH_ROOT}/cmake-android-out/lib) set(_mtk_llama_executor_runner__srcs ${_mtk_executor_runner__srcs}) list(FILTER _mtk_llama_executor_runner__srcs EXCLUDE REGEX @@ -140,8 +142,12 @@ if(${ANDROID}) set(LLAMA2_TOKENIZER_DIR ${EXTENSIONS_LLM_DIR}/tokenizers) add_library(tokenizer STATIC) target_include_directories( - tokenizer PUBLIC ${_common_include_directories} ${THIRD_PARTY_ABSL_DIR} - ${THIRD_PARTY_RE2_DIR} ${LLAMA2_TOKENIZER_DIR}/include + tokenizer PUBLIC + ${_common_include_directories} + ${THIRD_PARTY_ABSL_DIR} + ${THIRD_PARTY_RE2_DIR} + ${LLAMA2_TOKENIZER_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/mediatek/runtime/include ) target_link_libraries(tokenizer PRIVATE re2::re2) target_sources( @@ -152,11 +158,7 @@ if(${ANDROID}) ${CMAKE_CURRENT_SOURCE_DIR}/../models/llama/tokenizer/llama_tiktoken.cpp ) - # Include directory for neuron headers - include_directories( - BEFORE ${_common_include_directories} - ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/mediatek/runtime/include - ) + # Neuron headers are now included in individual targets # Build Llama Executor static library add_subdirectory(executor_runner/llama_runner) @@ -175,4 +177,5 @@ if(${ANDROID}) target_compile_options( mtk_llama_executor_runner PUBLIC ${_common_compile_options} ) + target_link_directories(mtk_llama_executor_runner PRIVATE ${EXECUTORCH_ROOT}/cmake-android-out/lib) endif() diff --git a/examples/mediatek/executor_runner/llama_runner/CMakeLists.txt b/examples/mediatek/executor_runner/llama_runner/CMakeLists.txt index 0448817d8eb..4d38d9e05b8 100644 --- a/examples/mediatek/executor_runner/llama_runner/CMakeLists.txt +++ b/examples/mediatek/executor_runner/llama_runner/CMakeLists.txt @@ -6,12 +6,9 @@ # Let include directory as "executorch/..." set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) -include_directories(BEFORE ${_common_include_directories}) +set(_mediatek_include_directories ${_common_include_directories}/backends/mediatek/runtime/include) -# shortcut include directory for neuron headers -include_directories( - BEFORE ${_common_include_directories}/backends/mediatek/runtime/include -) +# Include directories will be set on individual targets below add_library(llm_helper STATIC) target_sources( @@ -22,7 +19,11 @@ target_sources( target_link_libraries(llm_helper PRIVATE executorch_core) target_include_directories( - llm_helper PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} llm_helper/include + llm_helper PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + llm_helper/include + ${_common_include_directories} + ${_mediatek_include_directories} ) target_compile_options(llm_helper PRIVATE ${_common_compile_options}) @@ -39,3 +40,8 @@ target_sources( LlamaRuntime.cpp ) target_compile_options(mtk_llama_executor_lib PUBLIC ${_common_compile_options}) +target_include_directories( + mtk_llama_executor_lib PUBLIC + ${_common_include_directories} + ${_mediatek_include_directories} +) diff --git a/examples/models/llama/tokenizer/test/CMakeLists.txt b/examples/models/llama/tokenizer/test/CMakeLists.txt index 35aebf8d2a4..81c09665ce4 100644 --- a/examples/models/llama/tokenizer/test/CMakeLists.txt +++ b/examples/models/llama/tokenizer/test/CMakeLists.txt @@ -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}/../../../../..) diff --git a/examples/models/phi-3-mini/CMakeLists.txt b/examples/models/phi-3-mini/CMakeLists.txt index 9f7790cb8ab..e351dbf7ce5 100644 --- a/examples/models/phi-3-mini/CMakeLists.txt +++ b/examples/models/phi-3-mini/CMakeLists.txt @@ -13,7 +13,7 @@ # It should also be cmake-lint clean. # -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(phi_3_mini_runner) set(CMAKE_CXX_STANDARD 17) diff --git a/examples/portable/custom_ops/CMakeLists.txt b/examples/portable/custom_ops/CMakeLists.txt index 5a9a9a11fe6..45f9eb80552 100644 --- a/examples/portable/custom_ops/CMakeLists.txt +++ b/examples/portable/custom_ops/CMakeLists.txt @@ -14,7 +14,7 @@ # source file. This library can be linked into ExecuTorch binary # (`executor_runner` in this example) and it is ready to run models containing # that custom op. -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(custom_ops_example) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/examples/qualcomm/CMakeLists.txt b/examples/qualcomm/CMakeLists.txt index 757c7518f0c..6c9b962e3ae 100644 --- a/examples/qualcomm/CMakeLists.txt +++ b/examples/qualcomm/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD 17) # qnn_executor_runner: Like executor_runner but with QNN -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(qualcomm_runner_example) # Source root directory for executorch. diff --git a/examples/selective_build/CMakeLists.txt b/examples/selective_build/CMakeLists.txt index 39b212b16fb..4afc0f6b44a 100644 --- a/examples/selective_build/CMakeLists.txt +++ b/examples/selective_build/CMakeLists.txt @@ -15,7 +15,7 @@ # ~~~ # It should also be cmake-lint clean. # -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(selective_build_example) set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) diff --git a/exir/backend/test/demos/rpc/CMakeLists.txt b/exir/backend/test/demos/rpc/CMakeLists.txt index 97f90ea9baa..eb9784b1b25 100644 --- a/exir/backend/test/demos/rpc/CMakeLists.txt +++ b/exir/backend/test/demos/rpc/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) diff --git a/extension/apple/CMakeLists.txt b/extension/apple/CMakeLists.txt index 0e978073aa2..5119da073cf 100644 --- a/extension/apple/CMakeLists.txt +++ b/extension/apple/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) enable_language(Swift) diff --git a/extension/data_loader/CMakeLists.txt b/extension/data_loader/CMakeLists.txt index 6779160bcaf..87b2f9436c0 100644 --- a/extension/data_loader/CMakeLists.txt +++ b/extension/data_loader/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/extension/data_loader/test/CMakeLists.txt b/extension/data_loader/test/CMakeLists.txt index fbb8a4901d7..e9d50f5e6e3 100644 --- a/extension/data_loader/test/CMakeLists.txt +++ b/extension/data_loader/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/evalue_util/test/CMakeLists.txt b/extension/evalue_util/test/CMakeLists.txt index 452657ca7a5..9e26f6ff3c2 100644 --- a/extension/evalue_util/test/CMakeLists.txt +++ b/extension/evalue_util/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/flat_tensor/CMakeLists.txt b/extension/flat_tensor/CMakeLists.txt index d44ed811805..a31b67273a8 100644 --- a/extension/flat_tensor/CMakeLists.txt +++ b/extension/flat_tensor/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/extension/flat_tensor/test/CMakeLists.txt b/extension/flat_tensor/test/CMakeLists.txt index c3296dc61f3..3aae9c9634e 100644 --- a/extension/flat_tensor/test/CMakeLists.txt +++ b/extension/flat_tensor/test/CMakeLists.txt @@ -12,7 +12,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}/../../..) diff --git a/extension/kernel_util/test/CMakeLists.txt b/extension/kernel_util/test/CMakeLists.txt index 0e4ce6c462a..e36609f248e 100644 --- a/extension/kernel_util/test/CMakeLists.txt +++ b/extension/kernel_util/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/llm/custom_ops/CMakeLists.txt b/extension/llm/custom_ops/CMakeLists.txt index 7052568260b..0dad94c8161 100644 --- a/extension/llm/custom_ops/CMakeLists.txt +++ b/extension/llm/custom_ops/CMakeLists.txt @@ -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) diff --git a/extension/llm/custom_ops/spinquant/test/CMakeLists.txt b/extension/llm/custom_ops/spinquant/test/CMakeLists.txt index 7bca0df6513..b34aa1613b9 100644 --- a/extension/llm/custom_ops/spinquant/test/CMakeLists.txt +++ b/extension/llm/custom_ops/spinquant/test/CMakeLists.txt @@ -13,7 +13,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}/../../../../..) diff --git a/extension/llm/runner/test/CMakeLists.txt b/extension/llm/runner/test/CMakeLists.txt index 15b4d005f9d..22c2cc73fa3 100644 --- a/extension/llm/runner/test/CMakeLists.txt +++ b/extension/llm/runner/test/CMakeLists.txt @@ -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}/../../../..) diff --git a/extension/memory_allocator/test/CMakeLists.txt b/extension/memory_allocator/test/CMakeLists.txt index f6fc2062d45..df74278b344 100644 --- a/extension/memory_allocator/test/CMakeLists.txt +++ b/extension/memory_allocator/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/module/CMakeLists.txt b/extension/module/CMakeLists.txt index abf95f866f0..c2164bf6c4f 100644 --- a/extension/module/CMakeLists.txt +++ b/extension/module/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/extension/module/test/CMakeLists.txt b/extension/module/test/CMakeLists.txt index f5c1fd8d857..411dcb679f6 100644 --- a/extension/module/test/CMakeLists.txt +++ b/extension/module/test/CMakeLists.txt @@ -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}/../../..) diff --git a/extension/pytree/test/CMakeLists.txt b/extension/pytree/test/CMakeLists.txt index ce9b2cec6ec..218fb9ee2d9 100644 --- a/extension/pytree/test/CMakeLists.txt +++ b/extension/pytree/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/runner_util/CMakeLists.txt b/extension/runner_util/CMakeLists.txt index 3483b3babf3..e9c718f127a 100644 --- a/extension/runner_util/CMakeLists.txt +++ b/extension/runner_util/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/extension/runner_util/test/CMakeLists.txt b/extension/runner_util/test/CMakeLists.txt index 1be569cf4eb..4b02019798b 100644 --- a/extension/runner_util/test/CMakeLists.txt +++ b/extension/runner_util/test/CMakeLists.txt @@ -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}/../../..) diff --git a/extension/tensor/CMakeLists.txt b/extension/tensor/CMakeLists.txt index 51f955570db..398ed1f9bab 100644 --- a/extension/tensor/CMakeLists.txt +++ b/extension/tensor/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/extension/tensor/test/CMakeLists.txt b/extension/tensor/test/CMakeLists.txt index 0e5fd1d97ef..496086fe72a 100644 --- a/extension/tensor/test/CMakeLists.txt +++ b/extension/tensor/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/threadpool/CMakeLists.txt b/extension/threadpool/CMakeLists.txt index 6e107cb6634..0171b8515b8 100644 --- a/extension/threadpool/CMakeLists.txt +++ b/extension/threadpool/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/extension/threadpool/test/CMakeLists.txt b/extension/threadpool/test/CMakeLists.txt index e9b074ca47c..90c5e0f413a 100644 --- a/extension/threadpool/test/CMakeLists.txt +++ b/extension/threadpool/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/extension/training/CMakeLists.txt b/extension/training/CMakeLists.txt index 55537359cfe..c3e09973688 100644 --- a/extension/training/CMakeLists.txt +++ b/extension/training/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) diff --git a/kernels/optimized/CMakeLists.txt b/kernels/optimized/CMakeLists.txt index 7b8ebd58f13..830ee53b7d8 100644 --- a/kernels/optimized/CMakeLists.txt +++ b/kernels/optimized/CMakeLists.txt @@ -9,7 +9,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) diff --git a/kernels/portable/CMakeLists.txt b/kernels/portable/CMakeLists.txt index d301ea564f6..fa293e0888c 100644 --- a/kernels/portable/CMakeLists.txt +++ b/kernels/portable/CMakeLists.txt @@ -9,7 +9,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) diff --git a/kernels/portable/cpu/util/CMakeLists.txt b/kernels/portable/cpu/util/CMakeLists.txt index 8a2da87936d..219cc080da0 100644 --- a/kernels/portable/cpu/util/CMakeLists.txt +++ b/kernels/portable/cpu/util/CMakeLists.txt @@ -9,7 +9,7 @@ # cmake-format -i CMakeLists.txt # ~~~ -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) diff --git a/kernels/portable/cpu/util/test/CMakeLists.txt b/kernels/portable/cpu/util/test/CMakeLists.txt index d95b3a81b5c..87ffd5798ff 100644 --- a/kernels/portable/cpu/util/test/CMakeLists.txt +++ b/kernels/portable/cpu/util/test/CMakeLists.txt @@ -13,7 +13,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}/../../../../..) diff --git a/kernels/prim_ops/test/CMakeLists.txt b/kernels/prim_ops/test/CMakeLists.txt index c92daada12b..3df6ae8f654 100644 --- a/kernels/prim_ops/test/CMakeLists.txt +++ b/kernels/prim_ops/test/CMakeLists.txt @@ -12,7 +12,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}/../../..) diff --git a/kernels/quantized/CMakeLists.txt b/kernels/quantized/CMakeLists.txt index e5d1a94e068..88448f33468 100644 --- a/kernels/quantized/CMakeLists.txt +++ b/kernels/quantized/CMakeLists.txt @@ -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) diff --git a/kernels/test/CMakeLists.txt b/kernels/test/CMakeLists.txt index 4f174b5a652..07b76db0a0e 100644 --- a/kernels/test/CMakeLists.txt +++ b/kernels/test/CMakeLists.txt @@ -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}/../..) diff --git a/runtime/core/exec_aten/testing_util/test/CMakeLists.txt b/runtime/core/exec_aten/testing_util/test/CMakeLists.txt index a51717f43a2..92a179e40e1 100644 --- a/runtime/core/exec_aten/testing_util/test/CMakeLists.txt +++ b/runtime/core/exec_aten/testing_util/test/CMakeLists.txt @@ -13,7 +13,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}/../../../../..) diff --git a/runtime/core/exec_aten/util/test/CMakeLists.txt b/runtime/core/exec_aten/util/test/CMakeLists.txt index e806419e21e..8be77511210 100644 --- a/runtime/core/exec_aten/util/test/CMakeLists.txt +++ b/runtime/core/exec_aten/util/test/CMakeLists.txt @@ -13,7 +13,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}/../../../../..) diff --git a/runtime/core/portable_type/test/CMakeLists.txt b/runtime/core/portable_type/test/CMakeLists.txt index b1f57a93ab5..cbfa7f1175f 100644 --- a/runtime/core/portable_type/test/CMakeLists.txt +++ b/runtime/core/portable_type/test/CMakeLists.txt @@ -13,7 +13,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}/../../../..) diff --git a/runtime/core/test/CMakeLists.txt b/runtime/core/test/CMakeLists.txt index bdc427baf7d..d2e49a38de8 100644 --- a/runtime/core/test/CMakeLists.txt +++ b/runtime/core/test/CMakeLists.txt @@ -13,7 +13,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}/../../..) diff --git a/runtime/executor/test/CMakeLists.txt b/runtime/executor/test/CMakeLists.txt index c0b9c6c90c9..c4286494b11 100644 --- a/runtime/executor/test/CMakeLists.txt +++ b/runtime/executor/test/CMakeLists.txt @@ -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}/../../..) diff --git a/runtime/kernel/test/CMakeLists.txt b/runtime/kernel/test/CMakeLists.txt index 5a9c4f0febf..2634ef6c93e 100644 --- a/runtime/kernel/test/CMakeLists.txt +++ b/runtime/kernel/test/CMakeLists.txt @@ -12,7 +12,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}/../../..) diff --git a/runtime/platform/test/CMakeLists.txt b/runtime/platform/test/CMakeLists.txt index 356c05a01e7..82e7267eaa1 100644 --- a/runtime/platform/test/CMakeLists.txt +++ b/runtime/platform/test/CMakeLists.txt @@ -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}/../../..) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0e3a6703c54..b0d5a0947cd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,7 +16,7 @@ # It should also be cmake-lint clean. # -cmake_minimum_required(VERSION 3.19) +cmake_minimum_required(VERSION 3.24) project(size_test) set(CMAKE_CXX_STANDARD 17) diff --git a/test/utils/CMakeLists.txt b/test/utils/CMakeLists.txt index 9729d7d31b2..c6480e779cf 100644 --- a/test/utils/CMakeLists.txt +++ b/test/utils/CMakeLists.txt @@ -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}/../..) diff --git a/tools/cmake/Codegen.cmake b/tools/cmake/Codegen.cmake index 93331c7ed89..0e69672de6e 100644 --- a/tools/cmake/Codegen.cmake +++ b/tools/cmake/Codegen.cmake @@ -192,7 +192,7 @@ function(gen_custom_ops_aot_lib) # This lib uses ATen lib, so we explicitly enable rtti and exceptions. target_compile_options(${GEN_LIB_NAME} PRIVATE -frtti -fexceptions) target_compile_definitions(${GEN_LIB_NAME} PRIVATE USE_ATEN_LIB=1) - include_directories(${TORCH_INCLUDE_DIRS}) + target_include_directories(${GEN_LIB_NAME} PRIVATE ${TORCH_INCLUDE_DIRS}) target_link_libraries(${GEN_LIB_NAME} PRIVATE torch) target_link_options_shared_lib(${GEN_LIB_NAME})