MLIRStandaloneOpsIncGen
MLIRStandalonePassesIncGen
- LINK_LIBS PUBLIC
- MLIRIR
+ LINK_LIBS PUBLIC
+ MLIRIR
MLIRInferTypeOpInterface
MLIRFuncDialect
- )
+ )
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
-set(LIBS
- MLIRIR
- MLIRPass
- MLIRPluginsLib
- MLIRStandalone
- MLIRTransformUtils
- )
-
-add_mlir_dialect_library(StandalonePlugin
- SHARED
+add_llvm_library(StandalonePlugin
+ # BUILDTREE_ONLY is only for testing purposes
+ MODULE BUILDTREE_ONLY
standalone-plugin.cpp
DEPENDS
MLIRStandalone
- )
+ PLUGIN_TOOL
+ mlir-opt
-llvm_update_compile_flags(StandalonePlugin)
-target_link_libraries(StandalonePlugin PRIVATE ${LIBS})
-
-mlir_check_all_link_libraries(StandalonePlugin)
+ LINK_LIBS
+ MLIRStandalone
+ )
+target_include_directories(
+ StandalonePlugin
+ PRIVATE
+ "${STANDALONE_BINARY_DIR}/include"
+)
standalone-capi-test
standalone-opt
standalone-translate
+ StandalonePlugin
)
if(MLIR_ENABLE_BINDINGS_PYTHON)
list(APPEND STANDALONE_TEST_DEPENDS StandalonePythonModules)
-// RUN: mlir-opt %s --load-pass-plugin=%standalone_libs/libStandalonePlugin.so --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s
+// RUN: mlir-opt %s --load-pass-plugin=%standalone_libs/StandalonePlugin%shlibext --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s
module {
// CHECK-LABEL: func @foo()
-// RUN: mlir-opt %s --load-dialect-plugin=%standalone_libs/libStandalonePlugin.so --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s
+// RUN: mlir-opt %s --load-dialect-plugin=%standalone_libs/StandalonePlugin%shlibext --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s
module {
// CHECK-LABEL: func @foo()
config.test_exec_root = os.path.join(config.standalone_obj_root, 'test')
config.substitutions.append(('%PATH%', config.environment['PATH']))
+config.substitutions.append(('%shlibext', config.llvm_shlib_ext))
llvm_config.with_system_environment(
['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
config.mlir_obj_dir = "@MLIR_BINARY_DIR@"
config.enable_bindings_python = @MLIR_ENABLE_BINDINGS_PYTHON@
config.standalone_obj_root = "@STANDALONE_BINARY_DIR@"
+config.llvm_shlib_ext = "@SHLIBEXT@"
import lit.llvm
lit.llvm.initialize(lit_config, config)
-# RUN: %cmake_exe %mlir_src_root/examples/standalone -G "%cmake_generator" \
+# RUN: "%cmake_exe" "%mlir_src_root/examples/standalone" -G "%cmake_generator" \
# RUN: -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc \
# RUN: -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir \
# RUN: -DLLVM_USE_LINKER=%llvm_use_linker \
# RUN: -DPython3_EXECUTABLE=%python
-# RUN: %cmake_exe --build . --target check-standalone | tee %t | FileCheck %s
+# RUN: "%cmake_exe" --build . --target check-standalone | tee %t | FileCheck %s
# Note: The number of checked tests is not important. The command will fail
# if any fail.