@@ -49,17 +49,6 @@ cmake_minimum_required(VERSION 3.24)
4949
5050set (EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR } )
5151
52- # Hexagon toolchain with release build complains about code in third party
53- # libraries.
54- if ("${CMAKE_SYSTEM_PROCESSOR } " MATCHES "Hexagon" AND "${CMAKE_BUILD_TYPE } "
55- STREQUAL "Release"
56- )
57- add_compile_options (
58- -Wno-error=format -Wno-error=implicit-int-conversion
59- -Wno-error=unused-variable -Wno-error=unused-function
60- )
61- endif ()
62-
6352# --- ExecuTorch Version ---
6453# Parse version from version.txt (single source of truth)
6554file (READ "${EXECUTORCH_ROOT} /version.txt" ET_VERSION_STRING )
@@ -90,6 +79,18 @@ project(executorch
9079 VERSION "${ET_VERSION_MAJOR} .${ET_VERSION_MINOR} .${ET_VERSION_PATCH} "
9180)
9281
82+ # Hexagon toolchain with release build complains about code in third party
83+ # libraries. Must come after project(), which runs the toolchain file that sets
84+ # CMAKE_SYSTEM_PROCESSOR, and before add_subdirectory(third-party).
85+ if ("${CMAKE_SYSTEM_PROCESSOR } " MATCHES "Hexagon" AND "${CMAKE_BUILD_TYPE } "
86+ STREQUAL "Release"
87+ )
88+ add_compile_options (
89+ -Wno-error=format -Wno-error=implicit-int-conversion
90+ -Wno-error=unused-variable -Wno-error=unused-function
91+ )
92+ endif ()
93+
9394message (
9495 STATUS
9596 "ExecuTorch version: ${ET_VERSION_MAJOR} .${ET_VERSION_MINOR} .${ET_VERSION_PATCH} "
@@ -764,6 +765,20 @@ if(EXECUTORCH_BUILD_CUDA
764765 find_package_torch ()
765766endif ()
766767
768+ # Backend-neutral caller-stream guard consumed by the CUDA AOTI backend (and the
769+ # vendored torch-tensorrt delegate). Built before backends/aoti and
770+ # backends/cuda, which link it.
771+ if (EXECUTORCH_BUILD_CUDA)
772+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR } /extension/cuda )
773+ install (
774+ DIRECTORY extension/cuda/
775+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /executorch/extension/cuda
776+ FILES_MATCHING
777+ PATTERN "*.h"
778+ )
779+ list (APPEND _executorch_extensions extension_cuda)
780+ endif ()
781+
767782# Build common AOTI functionality if needed by CUDA or Metal backends
768783if (EXECUTORCH_BUILD_CUDA OR EXECUTORCH_BUILD_METAL)
769784 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR } /backends/aoti )
@@ -1026,6 +1041,10 @@ if(EXECUTORCH_BUILD_PYBIND)
10261041 list (APPEND _dep_libs coremldelegate)
10271042 endif ()
10281043
1044+ if (EXECUTORCH_BUILD_VGF)
1045+ list (APPEND _dep_libs vgf_backend)
1046+ endif ()
1047+
10291048 if (EXECUTORCH_BUILD_MPS)
10301049 list (APPEND _dep_libs mpsdelegate)
10311050 endif ()
0 commit comments