[flang-commits] [flang] 532e639 - [flang] [cmake] Call mlir_target_link_libraries() only with MLIR_LIBS

Michał Górny via flang-commits flang-commits at lists.llvm.org
Thu Jan 16 06:03:01 PST 2025


Author: Michał Górny
Date: 2025-01-16T15:02:44+01:00
New Revision: 532e639ec66876092d7930cc8b89eb54ebf9c6b7

URL: https://github.com/llvm/llvm-project/commit/532e639ec66876092d7930cc8b89eb54ebf9c6b7
DIFF: https://github.com/llvm/llvm-project/commit/532e639ec66876092d7930cc8b89eb54ebf9c6b7.diff

LOG: [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 6a2cc122296b04a4f09768a714a74ffc82b7be87

Added: 
    

Modified: 
    flang/cmake/modules/AddFlang.cmake

Removed: 
    


################################################################################
diff  --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake
index b2fcc5e13cf74f..1f178772067edc 100644
--- a/flang/cmake/modules/AddFlang.cmake
+++ b/flang/cmake/modules/AddFlang.cmake
@@ -66,7 +66,9 @@ function(add_flang_library name)
   llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
 
   clang_target_link_libraries(${name} PRIVATE ${ARG_CLANG_LIBS})
-  mlir_target_link_libraries(${name} PRIVATE ${ARG_MLIR_LIBS})
+  if (ARG_MLIR_LIBS)
+    mlir_target_link_libraries(${name} PRIVATE ${ARG_MLIR_LIBS})
+  endif()
 
   if (TARGET ${name})
 


        


More information about the flang-commits mailing list