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
)
