Skip to content

Commit 58b70ce

Browse files
committed
Update on "[slimtensor] integration into backend"
Differential Revision: [D90606409](https://our.internmc.facebook.com/intern/diff/D90606409/) [ghstack-poisoned]
1 parent 0e0d0a0 commit 58b70ce

File tree

5 files changed

+842
-1299
lines changed

5 files changed

+842
-1299
lines changed

backends/aoti/CMakeLists.txt

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,25 @@ endif()
2525
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
2626
find_package_torch()
2727

28-
# Common AOTI functionality - combines all AOTI common components
29-
set(_aoti_common_sources common_shims.cpp)
30-
add_library(aoti_common STATIC ${_aoti_common_sources})
28+
# Common AOTI functionality - header-only library for common shims
29+
add_library(aoti_common INTERFACE)
3130
target_include_directories(
3231
aoti_common
33-
PUBLIC $<BUILD_INTERFACE:${EXECUTORCH_ROOT}> $<INSTALL_INTERFACE:include>
34-
$<BUILD_INTERFACE:${EXECUTORCH_ROOT}/..>
32+
INTERFACE $<BUILD_INTERFACE:${EXECUTORCH_ROOT}>
33+
$<INSTALL_INTERFACE:include>
34+
$<BUILD_INTERFACE:${EXECUTORCH_ROOT}/..>
3535
)
3636
target_compile_options(
3737
aoti_common
38-
PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/EHsc /GR>
39-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fexceptions -frtti -fPIC>
38+
INTERFACE $<$<CXX_COMPILER_ID:MSVC>:/EHsc /GR>
39+
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fexceptions -frtti -fPIC>
4040
)
4141
target_compile_definitions(
42-
aoti_common PRIVATE $<$<PLATFORM_ID:Windows>:EXPORT_AOTI_FUNCTIONS>
42+
aoti_common INTERFACE $<$<PLATFORM_ID:Windows>:EXPORT_AOTI_FUNCTIONS>
4343
)
44-
# Ensure symbols are exported properly
45-
if(APPLE)
46-
target_link_options(aoti_common PUBLIC -Wl,-export_dynamic)
47-
else()
48-
target_link_options(
49-
aoti_common PUBLIC $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wl,--export-dynamic>
50-
)
51-
endif()
5244

5345
# Link against ExecuTorch libraries and standard libraries
54-
target_link_libraries(aoti_common PUBLIC extension_tensor ${CMAKE_DL_LIBS})
55-
executorch_target_link_options_shared_lib(aoti_common)
46+
target_link_libraries(aoti_common INTERFACE extension_tensor ${CMAKE_DL_LIBS})
5647

5748
install(
5849
TARGETS aoti_common

0 commit comments

Comments
 (0)