2021-02-14 03:23:06 +08:00
|
|
|
add_subdirectory(Dialect)
|
|
|
|
add_subdirectory(Conversion)
|
|
|
|
add_subdirectory(ExecutionEngine)
|
2020-08-05 20:36:16 +08:00
|
|
|
add_subdirectory(IR)
|
|
|
|
add_subdirectory(Registration)
|
2020-11-04 05:38:34 +08:00
|
|
|
add_subdirectory(Transforms)
|
2020-11-09 08:49:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# libMLIRPublicAPI shared library/DLL.
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
get_property(public_api_libs GLOBAL PROPERTY MLIR_PUBLIC_C_API_LIBS)
|
|
|
|
|
|
|
|
foreach(lib ${public_api_libs})
|
|
|
|
if(XCODE)
|
|
|
|
# Xcode doesn't support object libraries, so we have to trick it into
|
|
|
|
# linking the static libraries instead.
|
|
|
|
list(APPEND _DEPS "-force_load" ${lib})
|
|
|
|
else()
|
|
|
|
list(APPEND _OBJECTS $<TARGET_OBJECTS:obj.${lib}>)
|
|
|
|
endif()
|
|
|
|
# Accumulate transitive deps of each exported lib into _DEPS.
|
|
|
|
list(APPEND _DEPS $<TARGET_PROPERTY:${lib},LINK_LIBRARIES>)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_mlir_library(MLIRPublicAPI
|
|
|
|
SHARED
|
|
|
|
${_OBJECTS}
|
|
|
|
EXCLUDE_FROM_LIBMLIR
|
|
|
|
LINK_LIBS
|
|
|
|
# Dependency on the implementation shared library.
|
|
|
|
$<$<BOOL:${LLVM_BUILD_LLVM_DYLIB}>:MLIR>
|
|
|
|
${_DEPS}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_options(
|
|
|
|
MLIRPublicAPI
|
|
|
|
PRIVATE
|
|
|
|
# On Linux, disable re-export of any static linked libraries that
|
|
|
|
# came through.
|
|
|
|
$<$<PLATFORM_ID:Linux>:LINKER:--exclude-libs,ALL>
|
|
|
|
)
|