Skip to content

Commit 9a8f296

Browse files
[mlir] Hotfix - Fix Windows build
This revision adds a static `mlir_c_runner_utils_static` library for the sole purpose of being linked into `mlir_runner_utils` on Windows. It was previously reported that: ``` `add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)` produces *only* a dll on windows, the linking of mlir_runner_utils fails because target_link_libraries is looking for a .lib file as opposed to a .dll file. I think this may be a case where either we need to use LINK_LIBS or explicitly build a static lib as well, but I haven't tried either yet. ```
1 parent f2cd085 commit 9a8f296

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/ExecutionEngine/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ target_link_libraries(MLIRExecutionEngine
3636
${outlibs})
3737

3838
add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)
39+
add_llvm_library(mlir_c_runner_utils_static CRunnerUtils.cpp)
3940
target_compile_definitions(mlir_c_runner_utils PRIVATE mlir_c_runner_utils_EXPORTS)
4041

4142
add_llvm_library(mlir_runner_utils SHARED RunnerUtils.cpp)
4243
target_link_libraries(mlir_runner_utils
4344

44-
mlir_c_runner_utils
45+
mlir_c_runner_utils_static
4546
)
4647
target_compile_definitions(mlir_runner_utils PRIVATE mlir_runner_utils_EXPORTS)

0 commit comments

Comments
 (0)