Commit 7a6c6897 authored by Stephen Neuendorffer's avatar Stephen Neuendorffer
Browse files

[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries.

When compiling libLLVM.so, add_llvm_library() manipulates the link libraries
being used.  This means that when using add_llvm_library(), we need to pass
the list of libraries to be linked (using the LINK_LIBS keyword) instead of
using the standard target_link_libraries call.  This is preparation for
properly dealing with creating libMLIR.so as well.

Differential Revision: https://reviews.llvm.org/D74864
parent 07aa9ae2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -41,4 +41,9 @@ target_link_libraries(toyc-ch6
    MLIRPass
    MLIRTargetLLVMIR
    MLIRTransforms
    LLVMOrcJIT
    LLVMSupport
    LLVMX86CodeGen
    LLVMX86Desc
    LLVMX86Info
    )
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@ target_link_libraries(toyc-ch7
    MLIRIR
    MLIRParser
    MLIRPass
    MLIRSupport
    MLIRTargetLLVMIR
    MLIRTransforms
    LLVMOrcJIT
    LLVMSupport
    LLVMX86CodeGen
    LLVMX86Desc
    LLVMX86Info
    )
+15 −4
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@ add_llvm_library(MLIRAnalysis

  ADDITIONAL_HEADER_DIRS
  ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis

  LINK_LIBS
  MLIRAffineOps
  MLIRIR
  MLIRLoopOps
  MLIRSupport
  LLVMSupport
  )
add_dependencies(MLIRAnalysis
  MLIRAffineOps
@@ -30,8 +37,6 @@ add_dependencies(MLIRAnalysis
  MLIRLoopOps
  )

target_link_libraries(MLIRAnalysis MLIRAffineOps MLIRLoopOps)

add_llvm_library(MLIRLoopAnalysis
  AffineAnalysis.cpp
  AffineStructures.cpp
@@ -41,6 +46,14 @@ add_llvm_library(MLIRLoopAnalysis

  ADDITIONAL_HEADER_DIRS
  ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis

  LINK_LIBS
  MLIRAffineOps
  MLIRIR
  MLIRLoopOps
  MLIRStandardOps
  MLIRSupport
  LLVMSupport
  )
add_dependencies(MLIRLoopAnalysis
  MLIRAffineOps
@@ -48,5 +61,3 @@ add_dependencies(MLIRLoopAnalysis
  MLIRTypeInferOpInterfaceIncGen
  MLIRLoopOps
  )

target_link_libraries(MLIRLoopAnalysis MLIRAffineOps MLIRLoopOps)
+6 −8
Original line number Diff line number Diff line
@@ -3,24 +3,22 @@ add_mlir_conversion_library(MLIRAffineToStandard

  ADDITIONAL_HEADER_DIRS
  ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/AffineToStandard
)
add_dependencies(
  MLIRAffineToStandard

  LINK_LIBS
  MLIRAffineOps
  MLIRLoopOps
  MLIRPass
  MLIRStandardOps
  MLIRTransforms
  MLIRIR
  LLVMCore
  LLVMSupport
  )
target_link_libraries(
add_dependencies(
  MLIRAffineToStandard

  MLIRAffineOps
  MLIRLoopOps
  MLIRPass
  MLIRStandardOps
  MLIRTransforms
  MLIRIR
  LLVMCore
  LLVMSupport
+7 −3
Original line number Diff line number Diff line
@@ -10,8 +10,12 @@ if (MLIR_CUDA_CONVERSIONS_ENABLED)
 list(APPEND SOURCES "ConvertKernelFuncToCubin.cpp")
endif()

add_mlir_conversion_library(MLIRGPUtoCUDATransforms ${SOURCES})
target_link_libraries(MLIRGPUtoCUDATransforms
add_mlir_conversion_library(MLIRGPUtoCUDATransforms
  ${SOURCES}
  LINK_LIBS
  LLVMNVPTXCodeGen
  LLVMNVPTXDesc
  LLVMNVPTXInfo
  MLIRGPU
  MLIRLLVMIR
  MLIRNVVMIR
Loading