[Mlir-commits] [mlir] 10bd67c - Install the MLIRTableGen static library.
Stella Laurenzo
llvmlistbot at llvm.org
Thu Jun 11 18:23:51 PDT 2020
Author: Stella Laurenzo
Date: 2020-06-11T18:23:24-07:00
New Revision: 10bd67c1bd462b422b865bc2ba63fda75af90060
URL: https://github.com/llvm/llvm-project/commit/10bd67c1bd462b422b865bc2ba63fda75af90060
DIFF: https://github.com/llvm/llvm-project/commit/10bd67c1bd462b422b865bc2ba63fda75af90060.diff
LOG: Install the MLIRTableGen static library.
Summary: * This library is special because of its dependencies so seems to have been inadvertently left out of installs.
Reviewers: antiagainst
Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D81693
Added:
Modified:
mlir/cmake/modules/AddMLIR.cmake
mlir/lib/TableGen/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
index 427d8c059ea0..e740b2d1cfcb 100644
--- a/mlir/cmake/modules/AddMLIR.cmake
+++ b/mlir/cmake/modules/AddMLIR.cmake
@@ -125,31 +125,7 @@ function(add_mlir_library name)
if(TARGET ${name})
target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
-
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- set(export_to_mlirtargets)
- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
- "mlir-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
- NOT LLVM_DISTRIBUTION_COMPONENTS)
- set(export_to_mlirtargets EXPORT MLIRTargets)
- set_property(GLOBAL PROPERTY MLIR_HAS_EXPORTS True)
- endif()
-
- install(TARGETS ${name}
- COMPONENT ${name}
- ${export_to_mlirtargets}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- RUNTIME DESTINATION bin)
-
- if (NOT LLVM_ENABLE_IDE)
- add_llvm_install_targets(install-${name}
- DEPENDS ${name}
- COMPONENT ${name})
- endif()
- set_property(GLOBAL APPEND PROPERTY MLIR_ALL_LIBS ${name})
- endif()
- set_property(GLOBAL APPEND PROPERTY MLIR_EXPORTS ${name})
+ add_mlir_library_install(${name})
else()
# Add empty "phony" target
add_custom_target(${name})
@@ -157,6 +133,36 @@ function(add_mlir_library name)
set_target_properties(${name} PROPERTIES FOLDER "MLIR libraries")
endfunction(add_mlir_library)
+# Adds an MLIR library target for installation.
+# This is usually done as part of add_mlir_library but is broken out for cases
+# where non-standard library builds can be installed.
+function(add_mlir_library_install name)
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ set(export_to_mlirtargets)
+ if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
+ "mlir-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
+ NOT LLVM_DISTRIBUTION_COMPONENTS)
+ set(export_to_mlirtargets EXPORT MLIRTargets)
+ set_property(GLOBAL PROPERTY MLIR_HAS_EXPORTS True)
+ endif()
+
+ install(TARGETS ${name}
+ COMPONENT ${name}
+ ${export_to_mlirtargets}
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ RUNTIME DESTINATION bin)
+
+ if (NOT LLVM_ENABLE_IDE)
+ add_llvm_install_targets(install-${name}
+ DEPENDS ${name}
+ COMPONENT ${name})
+ endif()
+ set_property(GLOBAL APPEND PROPERTY MLIR_ALL_LIBS ${name})
+ endif()
+ set_property(GLOBAL APPEND PROPERTY MLIR_EXPORTS ${name})
+endfunction()
+
# Declare the library associated with a dialect.
function(add_mlir_dialect_library name)
set_property(GLOBAL APPEND PROPERTY MLIR_DIALECT_LIBS ${name})
diff --git a/mlir/lib/TableGen/CMakeLists.txt b/mlir/lib/TableGen/CMakeLists.txt
index d7b131e83e93..77709c864955 100644
--- a/mlir/lib/TableGen/CMakeLists.txt
+++ b/mlir/lib/TableGen/CMakeLists.txt
@@ -33,3 +33,5 @@ llvm_add_library(MLIRTableGen STATIC
)
mlir_check_all_link_libraries(MLIRTableGen)
+
+add_mlir_library_install(MLIRTableGen)
More information about the Mlir-commits
mailing list