-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdependencies.cmake
75 lines (67 loc) · 1.91 KB
/
dependencies.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
if(NOT DEFINED ENV{LLVM_ROOT})
message(FATAL_ERROR "please set LLVM_ROOT to the root of llvm build folder (e.g. export LLVM_ROOT=<path-to-project>/_deps/mlirx/build")
endif()
if(NOT DEFINED ENV{HALIDE_SRC_DIR})
message(FATAL_ERROR "please set HALIDE_SRC_DIR to the root of HalideX source folder (e.g. export HALIDE_SRC_DIR=<path-to-project>/_deps/HalideX")
endif()
if(NOT DEFINED ENV{HALIDE_BUILD_DIR})
message(FATAL_ERROR "please set HALIDE_SRC_DIR to the root of HalideX build folder (e.g. export HALIDE_BUILD_DIR=<path-to-project>/_deps/HalideX/build")
endif()
set(LLVM_DIR $ENV{LLVM_ROOT}/lib/cmake/llvm)
set(MLIR_DIR $ENV{LLVM_ROOT}/lib/cmake/mlir)
find_package(MLIR REQUIRED CONFIG)
set(HALIDE_SRC_DIR $ENV{HALIDE_SRC_DIR})
set(HALIDE_BUILD_DIR $ENV{HALIDE_BUILD_DIR})
include_directories(${CMAKE_CURRENT_LIST_DIR}/include)
include_directories(${HALIDE_SRC_DIR})
include_directories(${HALIDE_SRC_DIR}/include/)
include_directories(${HALIDE_BUILD_DIR}/include/)
include_directories(${LLVM_INCLUDE_DIRS})
include_directories(${MLIR_INCLUDE_DIRS})
link_directories(${LLVM_BUILD_LIBRARY_DIR})
link_directories(${HALIDE_BUILD_DIR}/bin)
add_definitions(${LLVM_DEFINITIONS})
set(CMAKE_MODULE_PATH
${LLVM_CMAKE_DIR}
${MLIR_CMAKE_DIR}
)
include(AddLLVM)
include(TableGen)
include(AddMLIR)
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
set(DEP_FILES ${CMAKE_CURRENT_LIST_DIR}/CodeGen_MLIR.cpp)
set(DEP_LIBS
MainLib
Utils
${dialect_libs}
${conversion_libs}
MLIRLoopAnalysis
MLIRAnalysis
MLIRDialect
MLIROptLib
MLIRParser
MLIRPass
MLIRSPIRV
MLIRSPIRVTestPasses
MLIRSPIRVTransforms
MLIRTransforms
MLIRTransformUtils
MLIRTestDialect
MLIRTestIR
MLIRTestPass
MLIRTestTransforms
MLIRTargetLLVMIRImport
MLIRSupport
MLIRIR
MLIROptLib
LLVMSupport
LLVMCore
LLVMAsmParser
Halide
jpeg
png
pthread
dl
curses
)