@@ -373,7 +373,7 @@ if(NOT "${_repo_dir_name}" STREQUAL "executorch")
373373 "fix for this restriction."
374374 )
375375endif ()
376- set (_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR} /..)
376+ set (_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR} /.. ${CMAKE_CURRENT_SOURCE_DIR} /runtime/core/portable_type )
377377
378378#
379379# The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}.
@@ -556,6 +556,7 @@ endif()
556556target_include_directories (
557557 executorch_core PUBLIC ${_common_include_directories}
558558)
559+ target_compile_definitions (executorch_core PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
559560target_compile_options (executorch_core PUBLIC ${_common_compile_options} )
560561if (MAX_KERNEL_NUM)
561562 target_compile_definitions (
@@ -576,6 +577,7 @@ if(EXECUTORCH_BUILD_PYBIND AND APPLE)
576577 target_include_directories (
577578 executorch_core_shared PUBLIC ${_common_include_directories}
578579 )
580+ target_compile_definitions (executorch_core_shared PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
579581 target_compile_options (
580582 executorch_core_shared PUBLIC ${_common_compile_options}
581583 )
@@ -594,8 +596,9 @@ endif()
594596# any backends.
595597#
596598add_library (executorch ${_executorch__srcs} )
597- target_link_libraries (executorch PRIVATE executorch_core)
599+ target_link_libraries (executorch PUBLIC executorch_core)
598600target_include_directories (executorch PUBLIC ${_common_include_directories} )
601+ target_compile_definitions (executorch PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
599602target_compile_options (executorch PUBLIC ${_common_compile_options} )
600603target_link_options_shared_lib(executorch)
601604
@@ -629,6 +632,12 @@ endif()
629632
630633# Install `executorch` library as well as `executorch-config.cmake` under
631634# ${CMAKE_INSTALL_PREFIX}/
635+ install (DIRECTORY runtime/core/ DESTINATION include /executorch/runtime/core FILES_MATCHING PATTERN "*.h" )
636+ install (DIRECTORY runtime/kernel/ DESTINATION include /executorch/runtime/kernel FILES_MATCHING PATTERN "*.h" )
637+ install (DIRECTORY runtime/platform/ DESTINATION include /executorch/runtime/platform FILES_MATCHING PATTERN "*.h" )
638+ install (DIRECTORY extension/kernel_util/ DESTINATION include /executorch/extension/kernel_util FILES_MATCHING PATTERN "*.h" )
639+ install (DIRECTORY extension/tensor/ DESTINATION include /executorch/extension/tensor FILES_MATCHING PATTERN "*.h" )
640+ install (DIRECTORY extension/threadpool/ DESTINATION include /executorch/extension/threadpool FILES_MATCHING PATTERN "*.h" )
632641install (
633642 TARGETS executorch executorch_core
634643 DESTINATION lib
@@ -792,6 +801,8 @@ if(EXECUTORCH_BUILD_PYBIND)
792801 target_include_directories (
793802 util PUBLIC ${_common_include_directories} ${TORCH_INCLUDE_DIRS}
794803 )
804+ target_compile_definitions (util PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
805+
795806 target_compile_options (util PUBLIC ${_pybind_compile_options} )
796807 target_link_libraries (util PRIVATE torch c10 executorch extension_tensor)
797808
0 commit comments