forked from google/souper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
140 lines (114 loc) · 3.34 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# This file is automatically generated from cmake.toml - DO NOT EDIT
# See https://github.com/build-cpp/cmkr for more information
cmake_minimum_required(VERSION 3.15)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
endif()
# Regenerate CMakeLists.txt automatically in the root project
set(CMKR_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMKR_ROOT_PROJECT ON)
# Bootstrap cmkr
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
if(CMKR_INCLUDE_RESULT)
cmkr()
endif()
# Enable folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
# Create a configure-time dependency on cmake.toml to improve IDE support
if(CMKR_ROOT_PROJECT)
configure_file(cmake.toml cmake.toml COPYONLY)
endif()
project(Souper
VERSION
1.0
)
include("cmake/configure.cmake")
include(FetchContent)
message(STATUS "Fetching klee (pure-bv-qf-llvm-19.0)...")
FetchContent_Declare(klee
GIT_REPOSITORY
"https://github.com/mrexodia/klee"
GIT_TAG
pure-bv-qf-llvm-19.0
SOURCE_SUBDIR
fake
)
FetchContent_MakeAvailable(klee)
# Packages
find_package(Z3 REQUIRED)
find_package(Alive2 REQUIRED)
find_package(hiredis REQUIRED)
find_package(LLVM-Wrapper REQUIRED)
# Target souper
set(CMKR_TARGET souper)
set(souper_SOURCES "")
list(APPEND souper_SOURCES
"lib/Codegen/Codegen.cpp"
"lib/Codegen/MachineCost.cpp"
"lib/Extractor/Candidates.cpp"
"lib/Extractor/ExprBuilder.cpp"
"lib/Extractor/KLEEBuilder.cpp"
"lib/Extractor/Solver.cpp"
"lib/Infer/AbstractInterpreter.cpp"
"lib/Infer/AliveDriver.cpp"
"lib/Infer/ConstantSynthesis.cpp"
"lib/Infer/EnumerativeSynthesis.cpp"
"lib/Infer/InstSynthesis.cpp"
"lib/Infer/Interpreter.cpp"
"lib/Infer/Preconditions.cpp"
"lib/Infer/Pruning.cpp"
"lib/Inst/Inst.cpp"
"lib/KVStore/KVStore.cpp"
"lib/Parser/Parser.cpp"
"lib/SMTLIB2/Solver.cpp"
"lib/Tool/CandidateMapUtils.cpp"
"include/souper/Codegen/Codegen.h"
"include/souper/Extractor/Candidates.h"
"include/souper/Extractor/ExprBuilder.h"
"include/souper/Extractor/Solver.h"
"include/souper/Infer/AbstractInterpreter.h"
"include/souper/Infer/AliveDriver.h"
"include/souper/Infer/ConstantSynthesis.h"
"include/souper/Infer/EnumerativeSynthesis.h"
"include/souper/Infer/InstSynthesis.h"
"include/souper/Infer/Interpreter.h"
"include/souper/Infer/Preconditions.h"
"include/souper/Infer/Pruning.h"
"include/souper/Inst/Inst.h"
"include/souper/Inst/InstGraph.h"
"include/souper/KVStore/KVStore.h"
"include/souper/Parser/Parser.h"
"include/souper/SMTLIB2/Solver.h"
"include/souper/Tool/CandidateMapUtils.h"
"include/souper/Util/DfaUtils.h"
"include/souper/Util/LLVMUtils.h"
"include/souper/Util/UniqueNameSet.h"
)
list(APPEND souper_SOURCES
cmake.toml
)
set(CMKR_SOURCES ${souper_SOURCES})
add_library(souper STATIC)
if(souper_SOURCES)
target_sources(souper PRIVATE ${souper_SOURCES})
endif()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${souper_SOURCES})
target_compile_features(souper PUBLIC
cxx_std_20
)
target_include_directories(souper PRIVATE
include
"${klee_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
target_link_libraries(souper PUBLIC
alive2
hiredis::hiredis_static
LLVM-Wrapper
)
include("cmake/klee-expr.cmake")
include("cmake/package.cmake")
unset(CMKR_TARGET)
unset(CMKR_SOURCES)