build(build): 拆分子目录 CMakeLists 并规范目标命名
This commit is contained in:
26
src/ir/CMakeLists.txt
Normal file
26
src/ir/CMakeLists.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
add_library(ir_core STATIC
|
||||
Context.cpp
|
||||
Module.cpp
|
||||
Function.cpp
|
||||
BasicBlock.cpp
|
||||
Type.cpp
|
||||
Value.cpp
|
||||
Instruction.cpp
|
||||
IRBuilder.cpp
|
||||
IRPrinter.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ir_core PUBLIC
|
||||
build_options
|
||||
)
|
||||
|
||||
add_subdirectory(analysis)
|
||||
add_subdirectory(passes)
|
||||
|
||||
# 统一对外的 IR 依赖入口
|
||||
add_library(ir INTERFACE)
|
||||
target_link_libraries(ir INTERFACE
|
||||
ir_core
|
||||
ir_analysis
|
||||
ir_passes
|
||||
)
|
||||
9
src/ir/analysis/CMakeLists.txt
Normal file
9
src/ir/analysis/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
add_library(ir_analysis STATIC
|
||||
DominatorTree.cpp
|
||||
LoopInfo.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ir_analysis PUBLIC
|
||||
build_options
|
||||
ir_core
|
||||
)
|
||||
13
src/ir/passes/CMakeLists.txt
Normal file
13
src/ir/passes/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
add_library(ir_passes STATIC
|
||||
PassManager.cpp
|
||||
Mem2Reg.cpp
|
||||
ConstFold.cpp
|
||||
DCE.cpp
|
||||
CFGSimplify.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ir_passes PUBLIC
|
||||
build_options
|
||||
ir_core
|
||||
ir_analysis
|
||||
)
|
||||
Reference in New Issue
Block a user