-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (40 loc) · 1.86 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.10)
project(BrilCpp)
set(CMAKE_CXX_STANDARD 17)
find_package(nlohmann_json REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# Common library
set(COMMON_SOURCES
src/common/common.cpp
src/common/config.cpp
src/common/instr2str.cpp
src/common/logger.cpp
)
# Preprocess library
set(PREPROCESS_SOURCES
src/preprocess/buildBlocks.cpp
src/preprocess/buildCFG.cpp
src/preprocess/buildDataFlowInfo.cpp
)
# Optimization library
set(OPTIMIZATION_SOURCES
src/optimization/localValueNumbering.cpp
src/optimization/deadCodeElimination.cpp
)
add_library(bril_common ${COMMON_SOURCES})
add_library(bril_preprocess ${PREPROCESS_SOURCES})
add_library(bril_optimization ${OPTIMIZATION_SOURCES})
target_link_libraries(bril_common PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(bril_preprocess PRIVATE bril_common)
target_link_libraries(bril_optimization PRIVATE bril_common bril_preprocess)
# Executables
add_executable(build_blocks src/driver/buildBlocksMain.cpp)
target_link_libraries(build_blocks PRIVATE bril_common bril_preprocess nlohmann_json::nlohmann_json)
add_executable(build_cfg src/driver/buildCFGMain.cpp)
target_link_libraries(build_cfg PRIVATE bril_common bril_preprocess nlohmann_json::nlohmann_json)
add_executable(build_dataflow_info src/driver/buildDataFlowInfoMain.cpp)
target_link_libraries(build_dataflow_info PRIVATE bril_common bril_preprocess nlohmann_json::nlohmann_json)
add_executable(local_value_numbering src/driver/localValueNumberingMain.cpp)
target_link_libraries(local_value_numbering PRIVATE bril_common bril_preprocess bril_optimization nlohmann_json::nlohmann_json)
add_executable(dead_code_elimination src/driver/deadCodeEliminationMain.cpp)
target_link_libraries(dead_code_elimination PRIVATE bril_common bril_preprocess bril_optimization nlohmann_json::nlohmann_json)