@@ -25,34 +25,25 @@ endif()
2525include (${EXECUTORCH_ROOT} /tools/cmake/Utils.cmake)
2626find_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 )
3130target_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)
3636target_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)
4141target_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
5748install (
5849 TARGETS aoti_common
0 commit comments