[PATCH] D78773: Adjust libMLIR building to more closely follow libClang

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 22:14:39 PDT 2020


stephenneuendorffer added inline comments.


================
Comment at: mlir/cmake/modules/AddMLIR.cmake:90
+  if(TARGET ${name})
+    target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
+
----------------
stephenneuendorffer wrote:
> I think dependency problem is solved if you change INTERFACE to PUBLIC here.
Actually, nevermind, that's not going to help anything.


================
Comment at: mlir/tools/mlir-shlib/CMakeLists.txt:43
+  )
   target_link_libraries(MLIR PRIVATE LLVM ${LLVM_PTHREAD_LIB})
 endif()
----------------
Insert here:
+  foreach (lib ${mlir_libs})
+    add_dependencies(MLIR ${lib})
+  endforeach ()
seems to solve the dependency problem.  (Not fully tested)  I suspect the problem is that deep in the bowels of cmake it handles the dependencies different for object libraries.  These seem to not quite get the same dependency handling as target_link_libraries.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78773/new/

https://reviews.llvm.org/D78773





More information about the llvm-commits mailing list