Skip to content

Commit 45308cb

Browse files
committed
[MLIR] enable Standalone for Windows
1 parent 2508851 commit 45308cb

File tree

8 files changed

+25
-3
lines changed

8 files changed

+25
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ 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(("%cmke_exe_linker_flags", config.cmake_exe_linker_flags))
14+
config.substitutions.append(("%cmake_module_linker_flags", config.cmake_module_linker_flags))
15+
config.substitutions.append(("%cmake_shared_linker_flags", config.cmake_shared_linker_flags))
16+
config.substitutions.append(("%cmake_build_type", config.cmake_build_type))

mlir/test/Examples/standalone/test.toy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
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 \
6+
# RUN: -DCMAKE_EXE_LINKER_FLAGS="%cmke_exe_linker_flags" \
7+
# RUN: -DCMAKE_MODULE_LINKER_FLAGS="%cmake_module_linker_flags" \
8+
# RUN: -DCMAKE_SHARED_LINKER_FLAGS="%cmake_shared_linker_flags" \
59
# RUN: -DPython3_EXECUTABLE=%python \
610
# RUN: -DPython_EXECUTABLE=%python
711
# RUN: "%cmake_exe" --build . --target check-standalone | tee %t
@@ -11,4 +15,4 @@
1115
# if any fail.
1216
# CHECK: Passed
1317
# CHECK-NOT: Failed
14-
# UNSUPPORTED: target={{.*(windows|android).*}}
18+
# UNSUPPORTED: target={{.*(android).*}}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ 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@"
22+
config.cmake_exe_linker_flags = "@CMAKE_EXE_LINKER_FLAGS@"
23+
config.cmake_module_linker_flags = "@CMAKE_MODULE_LINKER_FLAGS@"
24+
config.cmake_shared_linker_flags = "@CMAKE_SHARED_LINKER_FLAGS@"
2125
config.llvm_use_linker = "@LLVM_USE_LINKER@"
2226
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
2327
config.host_arch = "@HOST_ARCH@"

0 commit comments

Comments
 (0)