[PATCH] D73130: [mlir] Shared library support

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 16:02:24 PST 2020


stephenneuendorffer added inline comments.


================
Comment at: mlir/cmake/modules/AddMLIR.cmake:47-50
+    if(NOT XCODE)
+      # The Xcode generator doesn't handle object libraries correctly.
+      list(APPEND LIBTYPE OBJECT)
+    endif()
----------------
This breaks the dependencies between .cpp files and the tablegen'd .inc files they depend on.  I believe the problem is that the CMakeFiles.txt are setup to use:
add_dependencies(someLib someRuleIncGen)

However, if OBJECT is specified, then llvm_add_library creates new targets which cannot replicate those dependencies.

The best solution is probably to mass-convert all the CMakeFiles.txt to use a DEPEND line when calling add_mlir_library.  This would get passed through to llvm_add_library and enable the newly created
targets (named obj.${name}) to be created with the correct dependencies.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73130





More information about the llvm-commits mailing list