Skip to content

Commit 7115abe

Browse files
committed
Update on "[ExecuTorch] Proof-of-concept: use c10/macros in ExecuTorch"
Step 0 for code sharing: can we use c10 Macros? This needs a guardrail to prevent breaking the ExecuTorch core requirements before we can ship it. What's our current guard against accidentally including streams/heap allocation/etc. in core at runtime? Differential Revision: [D65241695](https://our.internmc.facebook.com/intern/diff/D65241695/) [ghstack-poisoned]
1 parent dcd0aae commit 7115abe

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ message(STATUS "Using python executable '${PYTHON_EXECUTABLE}'")
324324
set(_common_compile_options -Wno-deprecated-declarations -fPIC)
325325

326326
# Let files say "include <executorch/path/to/header.h>".
327-
set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/..)
327+
find_package(Torch CONFIG REQUIRED)
328+
329+
set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/.. ${TORCH_INCLUDE_DIRS})
328330

329331
#
330332
# The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}.
@@ -507,9 +509,6 @@ endif()
507509
target_include_directories(
508510
executorch_core PUBLIC ${_common_include_directories}
509511
)
510-
target_include_directories(
511-
executorch_core INTERFACE ${TORCH_INCLUDE_DIRS}
512-
)
513512
target_compile_options(executorch_core PUBLIC ${_common_compile_options})
514513
if(MAX_KERNEL_NUM)
515514
target_compile_definitions(
@@ -671,8 +670,6 @@ if(EXECUTORCH_BUILD_PTHREADPOOL
671670
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/threadpool)
672671
endif()
673672

674-
find_package(Torch CONFIG REQUIRED)
675-
676673
if(EXECUTORCH_BUILD_PYBIND)
677674
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/pybind11)
678675

0 commit comments

Comments
 (0)