[Mlir-commits] [mlir] 4c18e1d - [MLIR] add cmake abstraction for translation libraries
Stephen Neuendorffer
llvmlistbot at llvm.org
Sat Apr 11 22:02:25 PDT 2020
Author: Stephen Neuendorffer
Date: 2020-04-11T22:02:16-07:00
New Revision: 4c18e1d3afefdee1f3ce6f110613344a3cde5622
URL: https://github.com/llvm/llvm-project/commit/4c18e1d3afefdee1f3ce6f110613344a3cde5622
DIFF: https://github.com/llvm/llvm-project/commit/4c18e1d3afefdee1f3ce6f110613344a3cde5622.diff
LOG: [MLIR] add cmake abstraction for translation libraries
Differential Revision: https://reviews.llvm.org/D77926
Added:
Modified:
mlir/cmake/modules/AddMLIR.cmake
mlir/lib/Target/CMakeLists.txt
mlir/tools/mlir-translate/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
index 2a71b2dc013c..99c4c313286b 100644
--- a/mlir/cmake/modules/AddMLIR.cmake
+++ b/mlir/cmake/modules/AddMLIR.cmake
@@ -46,3 +46,9 @@ function(add_mlir_conversion_library name)
set_property(GLOBAL APPEND PROPERTY MLIR_CONVERSION_LIBS ${name})
add_mlir_library(${ARGV})
endfunction(add_mlir_conversion_library)
+
+# Declare the library associated with a translation.
+function(add_mlir_translation_library name)
+ set_property(GLOBAL APPEND PROPERTY MLIR_TRANSLATION_LIBS ${name})
+ add_mlir_library(${ARGV})
+endfunction(add_mlir_translation_library)
diff --git a/mlir/lib/Target/CMakeLists.txt b/mlir/lib/Target/CMakeLists.txt
index 9bc37cab1093..ab4008a717a6 100644
--- a/mlir/lib/Target/CMakeLists.txt
+++ b/mlir/lib/Target/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_mlir_library(MLIRTargetLLVMIRModuleTranslation
+add_mlir_translation_library(MLIRTargetLLVMIRModuleTranslation
LLVMIR/DebugTranslation.cpp
LLVMIR/ModuleTranslation.cpp
@@ -18,7 +18,7 @@ target_link_libraries(MLIRTargetLLVMIRModuleTranslation
MLIRTranslation
)
-add_mlir_library(MLIRTargetAVX512
+add_mlir_translation_library(MLIRTargetAVX512
LLVMIR/LLVMAVX512Intr.cpp
ADDITIONAL_HEADER_DIRS
@@ -34,7 +34,7 @@ target_link_libraries(MLIRTargetAVX512
MLIRTargetLLVMIRModuleTranslation
)
-add_mlir_library(MLIRTargetLLVMIR
+add_mlir_translation_library(MLIRTargetLLVMIR
LLVMIR/ConvertFromLLVMIR.cpp
LLVMIR/ConvertToLLVMIR.cpp
@@ -46,7 +46,7 @@ target_link_libraries(MLIRTargetLLVMIR
MLIRTargetLLVMIRModuleTranslation
)
-add_mlir_library(MLIRTargetNVVMIR
+add_mlir_translation_library(MLIRTargetNVVMIR
LLVMIR/ConvertToNVVMIR.cpp
ADDITIONAL_HEADER_DIRS
@@ -63,7 +63,7 @@ target_link_libraries(MLIRTargetNVVMIR
MLIRTargetLLVMIRModuleTranslation
)
-add_mlir_library(MLIRTargetROCDLIR
+add_mlir_translation_library(MLIRTargetROCDLIR
LLVMIR/ConvertToROCDLIR.cpp
ADDITIONAL_HEADER_DIRS
diff --git a/mlir/tools/mlir-translate/CMakeLists.txt b/mlir/tools/mlir-translate/CMakeLists.txt
index be6840c8ddc2..9dc5971703ab 100644
--- a/mlir/tools/mlir-translate/CMakeLists.txt
+++ b/mlir/tools/mlir-translate/CMakeLists.txt
@@ -1,14 +1,11 @@
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
+get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
set(LIBS
${dialect_libs}
+ ${translation_libs}
MLIRParser
MLIRPass
MLIRSPIRV
- MLIRSPIRVSerialization
- MLIRTargetAVX512
- MLIRTargetLLVMIR
- MLIRTargetNVVMIR
- MLIRTargetROCDLIR
MLIRTranslation
MLIRSupport
)
More information about the Mlir-commits
mailing list