Skip to content

Commit 532e639

Browse files
committed
[flang] [cmake] Call mlir_target_link_libraries() only with MLIR_LIBS
Do not call `mlir_target_link_libraries()` when there are no `MLIR_LIBS` specified. This fixes a failure when `flang/runtime` is being built standalone, as it does not use MLIR and therefore the function is not defined: https://lab.llvm.org/buildbot/#/builders/152/builds/932 Fixes 6a2cc12
1 parent 6a2cc12 commit 532e639

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flang/cmake/modules/AddFlang.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ function(add_flang_library name)
6666
llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
6767

6868
clang_target_link_libraries(${name} PRIVATE ${ARG_CLANG_LIBS})
69-
mlir_target_link_libraries(${name} PRIVATE ${ARG_MLIR_LIBS})
69+
if (ARG_MLIR_LIBS)
70+
mlir_target_link_libraries(${name} PRIVATE ${ARG_MLIR_LIBS})
71+
endif()
7072

7173
if (TARGET ${name})
7274

0 commit comments

Comments
 (0)