Skip to content

Commit

Permalink
mlir: try to export mlir targets to MLIRTargets
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Oct 28, 2021
1 parent 85371d7 commit 976da12
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
35 changes: 35 additions & 0 deletions mingw-w64-clang/0009-export-out-of-tree-mlir-targets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -179,14 +179,18 @@
endif()

if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
- set(export_to_llvmexports)
+ set(export_to_project_exports)
if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
- set(export_to_llvmexports EXPORT LLVMExports)
+ if(${CMAKE_PROJECT_NAME} STREQUAL "mlir" AND ${project} STREQUAL "MLIR")
+ set(export_to_project_exports EXPORT MLIRTargets)
+ else()
+ set(export_to_project_exports EXPORT LLVMExports)
+ endif()
endif()

install(TARGETS ${target}
- ${export_to_llvmexports}
+ ${export_to_project_exports}
COMPONENT ${target}
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
if(NOT LLVM_ENABLE_IDE)
@@ -195,5 +199,9 @@
COMPONENT ${target})
endif()
endif()
- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
+ if(${CMAKE_PROJECT_NAME} STREQUAL "mlir" AND ${project} STREQUAL "MLIR")
+ set_property(GLOBAL APPEND PROPERTY MLIR_EXPORTS ${target})
+ else()
+ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
+ endif()
endmacro()
5 changes: 5 additions & 0 deletions mingw-w64-clang/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
"0003-CMake-try-creating-symlink-first-on-windows.patch"
"0005-add-pthread-as-system-lib-for-mingw.patch"
"0008-enable-emutls-for-mingw.patch"
"0009-export-out-of-tree-mlir-targets.patch"
"0101-Disable-fPIC-errors.patch"
"0103-Use-posix-style-path-separators-with-MinGW.patch"
"0104-link-pthread-with-mingw.patch"
Expand Down Expand Up @@ -85,6 +86,7 @@ sha256sums=('408d11708643ea826f519ff79761fcdfc12d641a2510229eec459e72f8163020'
'5cd56dd01716a37ef6981793a57bea07260b44d91592c1d8b8bde0c3497884f0'
'7f0c64cd87b61e894be632f180ae5291e1aa9f1d9d382608f659067eeeda7146'
'3837bd707d3d99a742e874d5c59a1e7d5502811d6926319974c5d9db86020039'
'cb96582194ef80a37cc184e95287920b2df5369e2e5798a64adf6f8bf1c52985'
'63b2bda6a487ec69e257c3b7a14d71f6bec649fca058a5a54804f213d45c7c70'
'2d1dc7f7cd6bd61f275cd0be6650f3086aee622074ac786ff5a921bf8ecaada2'
'715cb8862753854b2d9256e0b70003e2d1f57083d83eaeaf5a095fc72b8a4e26'
Expand Down Expand Up @@ -134,6 +136,9 @@ prepare() {
"0008-enable-emutls-for-mingw.patch"
fi

apply_patch_with_msg \
"0009-export-out-of-tree-mlir-targets.patch"

cd "${srcdir}/clang"
apply_patch_with_msg \
"0101-Disable-fPIC-errors.patch" \
Expand Down

0 comments on commit 976da12

Please sign in to comment.