-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
35 lines (27 loc) · 1.13 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
PROJECT(CISA)
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
FIND_PACKAGE(LLVM REQUIRED CONFIG)
FIND_PACKAGE(PythonInterp REQUIRED)
ADD_DEFINITIONS(${LLVM_DEFINITIONS})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Add external libraries
ADD_SUBDIRECTORY(extern ${CMAKE_BINARY_DIR}/extern)
# Include helpers
INCLUDE(CMakePackageConfigHelpers)
# Sources for driver
FILE(GLOB CISA_SOURCES "src/*.cc" "src/analyzer/*.cc" "src/callgraph/*.cc")
# Version information
SET(CISA_VERSION_MAJOR 0)
SET(CISA_VERSION_MINOR 1)
SET(CISA_VERSION_REV 0)
SET(CISA_VERSION_STRING "${CISA_VERSION_MAJOR}.${CISA_VERSION_MINOR}.${CISA_VERSION_REV}")
# Build cisa
# TODO: "getPointerElementType" in MLTA should be replaced in the future.
SET(CMAKE_CXX_FLAGS "-gdwarf-4 -Wno-deprecated-declarations")
ADD_DEFINITIONS(${LLVM_DEFINITIONS})
INCLUDE_DIRECTORIES(${LLVM_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} "include")
PYBIND11_ADD_MODULE(cisa ${CISA_SOURCES})
SET_TARGET_PROPERTIES(cisa PROPERTIES CXX_STANDARD 17)
TARGET_LINK_LIBRARIES(cisa PRIVATE LLVMAsmParser LLVMSupport LLVMCore
LLVMAnalysis LLVMIRReader)