Skip to content

Commit 1a6b2b6

Browse files
authored
[MLIR] enable Standalone example test for Windows (#158183)
This PR turns on all Standalone tests for Windows except for the plugins (which aren't enabled by default).
1 parent 5fd3aad commit 1a6b2b6

File tree

8 files changed

+16
-3
lines changed

8 files changed

+16
-3
lines changed

mlir/examples/standalone/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,7 @@ if(MLIR_ENABLE_BINDINGS_PYTHON)
6060
endif()
6161
add_subdirectory(test)
6262
add_subdirectory(standalone-opt)
63-
add_subdirectory(standalone-plugin)
63+
if(NOT WIN32)
64+
add_subdirectory(standalone-plugin)
65+
endif()
6466
add_subdirectory(standalone-translate)

mlir/examples/standalone/python/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ declare_mlir_python_extension(StandalonePythonSources.Pybind11Extension
2626
ADD_TO_PARENT StandalonePythonSources
2727
SOURCES
2828
StandaloneExtensionPybind11.cpp
29+
PRIVATE_LINK_LIBS
30+
LLVMSupport
2931
EMBED_CAPI_LINK_LIBS
3032
StandaloneCAPI
3133
PYTHON_BINDINGS_LIBRARY pybind11
@@ -36,6 +38,8 @@ declare_mlir_python_extension(StandalonePythonSources.NanobindExtension
3638
ADD_TO_PARENT StandalonePythonSources
3739
SOURCES
3840
StandaloneExtensionNanobind.cpp
41+
PRIVATE_LINK_LIBS
42+
LLVMSupport
3943
EMBED_CAPI_LINK_LIBS
4044
StandaloneCAPI
4145
PYTHON_BINDINGS_LIBRARY nanobind

mlir/examples/standalone/test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ set(STANDALONE_TEST_DEPENDS
1414
standalone-capi-test
1515
standalone-opt
1616
standalone-translate
17-
StandalonePlugin
1817
)
18+
if(NOT WIN32)
19+
list(APPEND STANDALONE_TEST_DEPENDS StandalonePlugin)
20+
endif()
1921
if(MLIR_ENABLE_BINDINGS_PYTHON)
2022
list(APPEND STANDALONE_TEST_DEPENDS StandalonePythonModules)
2123
endif()

mlir/examples/standalone/test/Standalone/standalone-pass-plugin.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// UNSUPPORTED: system-windows
12
// RUN: mlir-opt %s --load-pass-plugin=%standalone_libs/StandalonePlugin%shlibext --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s
23

34
module {

mlir/examples/standalone/test/Standalone/standalone-plugin.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// UNSUPPORTED: system-windows
12
// RUN: mlir-opt %s --load-dialect-plugin=%standalone_libs/StandalonePlugin%shlibext --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s
23

34
module {

mlir/test/Examples/standalone/lit.local.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ config.substitutions.append(("%host_cc", config.host_cc))
1010
config.substitutions.append(("%enable_libcxx", config.enable_libcxx))
1111
config.substitutions.append(("%mlir_cmake_dir", config.mlir_cmake_dir))
1212
config.substitutions.append(("%llvm_use_linker", config.llvm_use_linker))
13+
config.substitutions.append(("%cmake_build_type", config.cmake_build_type))

mlir/test/Examples/standalone/test.toy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# RUN: "%cmake_exe" "%mlir_src_root/examples/standalone" -G "%cmake_generator" \
2+
# RUN: -DCMAKE_BUILD_TYPE=%cmake_build_type \
23
# RUN: -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc \
34
# RUN: -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir \
45
# RUN: -DLLVM_USE_LINKER=%llvm_use_linker \
@@ -11,4 +12,4 @@
1112
# if any fail.
1213
# CHECK: Passed
1314
# CHECK-NOT: Failed
14-
# UNSUPPORTED: target={{.*(windows|android).*}}
15+
# UNSUPPORTED: target={{.*(android).*}}

mlir/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config.host_cxx = "@HOST_CXX@"
1818
config.enable_libcxx = "@LLVM_ENABLE_LIBCXX@"
1919
config.host_cmake = "@CMAKE_COMMAND@"
2020
config.host_cmake_generator = "@CMAKE_GENERATOR@"
21+
config.cmake_build_type = "@CMAKE_BUILD_TYPE@"
2122
config.llvm_use_linker = "@LLVM_USE_LINKER@"
2223
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
2324
config.host_arch = "@HOST_ARCH@"

0 commit comments

Comments
 (0)