1
- # the dependency list copied from mlir/tools/mlir-cpu-runner/CMakeLists.txt of upstream
2
- set (LLVM_LINK_COMPONENTS
3
- Core
4
- Support
5
- nativecodegen
6
- native
7
- )
8
- set (MLIR_LINK_COMPONENTS
9
- MLIRAnalysis
10
- MLIRBuiltinToLLVMIRTranslation
11
- MLIRExecutionEngine
12
- MLIRIR
13
- MLIRJitRunner
14
- MLIRLLVMDialect
15
- MLIRLLVMToLLVMIRTranslation
16
- MLIRToLLVMIRTranslationRegistration
17
- MLIRParser
18
- MLIRTargetLLVMIRExport
19
- MLIRSupport
20
- )
1
+ if (GC_DEV_LINK_LLVM_DYLIB)
2
+ set (LLVM_LINK_COMPONENTS
3
+ LLVM
4
+ )
5
+ set (MLIR_LINK_COMPONENTS
6
+ MLIR
7
+ MLIRExecutionEngineShared
8
+ MLIRJitRunner
9
+ )
10
+ else ()
11
+ # the dependency list copied from mlir/tools/mlir-cpu-runner/CMakeLists.txt of upstream
12
+ set (LLVM_LINK_COMPONENTS
13
+ Core
14
+ Support
15
+ nativecodegen
16
+ native
17
+ )
18
+ set (MLIR_LINK_COMPONENTS
19
+ MLIRAnalysis
20
+ MLIRBuiltinToLLVMIRTranslation
21
+ MLIRExecutionEngine
22
+ MLIRIR
23
+ MLIRJitRunner
24
+ MLIRLLVMDialect
25
+ MLIRLLVMToLLVMIRTranslation
26
+ MLIRToLLVMIRTranslationRegistration
27
+ MLIRParser
28
+ MLIRTargetLLVMIRExport
29
+ MLIRSupport
30
+ )
31
+ endif ()
21
32
22
33
if (GC_MLIR_CXX_FLAGS)
23
34
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GC_MLIR_CXX_FLAGS} " )
@@ -26,8 +37,10 @@ endif()
26
37
#LLVM_LINK_COMPONENTS is processed by LLVM cmake in add_llvm_executable
27
38
set (gc_cpu_runner_libs
28
39
${MLIR_LINK_COMPONENTS} )
29
- add_llvm_executable(gc-cpu-runner gc-cpu-runner.cpp)
40
+ add_mlir_tool(gc-cpu-runner
41
+ gc-cpu-runner.cpp
42
+ )
43
+ llvm_update_compile_flags(gc-cpu-runner)
30
44
31
45
target_link_libraries (gc-cpu-runner PRIVATE ${gc_cpu_runner_libs} )
32
- llvm_update_compile_flags(gc-cpu-runner)
33
46
mlir_check_all_link_libraries(gc-cpu-runner)
0 commit comments