Files
clang-p2996/flang/lib/Optimizer/Support/CMakeLists.txt
Michał Górny 6a2cc12229 [flang] Support linking to MLIR dylib (#120966)
Introduce a new `MLIR_LIBS` argument to `add_flang_library`, that uses
`mlir_target_link_libraries` to link the MLIR dylib alterantively to the
component libraries. Use it, along with a few inline
`mlir_target_link_libraries` in tools, to support linking Flang to MLIR
dylib rather than the static libraries.

With these changes, the vast majority of Flang can be linked
dynamically. The only parts still using static libraries are these
requiring MLIR test libraries, that are not included in the dylib.
2025-01-16 13:35:26 +00:00

33 lines
600 B
CMake

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
add_flang_library(FIRSupport
DataLayout.cpp
InitFIR.cpp
InternalNames.cpp
Utils.cpp
DEPENDS
FIROpsIncGen
HLFIROpsIncGen
MLIRIR
${dialect_libs}
${extension_libs}
LINK_LIBS
FIRDialect
LINK_COMPONENTS
TargetParser
MLIR_LIBS
${dialect_libs}
${extension_libs}
MLIRBuiltinToLLVMIRTranslation
MLIROpenACCToLLVMIRTranslation
MLIROpenMPToLLVMIRTranslation
MLIRLLVMToLLVMIRTranslation
MLIRTargetLLVMIRExport
MLIRTargetLLVMIRImport
)