-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (28 loc) · 1001 Bytes
/
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
cmake_minimum_required(VERSION 3.13)
project(pdg-analyzer)
set(CMAKE_CXX_STANDARD 14)
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Using LLVM ${LLVM_PACKAGE_VERSION}")
add_definitions(${LLVM_DEFINITIONS})
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIR})
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
# Handle RTTI stuff, which often leads to error
if(NOT ${LLVM_ENABLE_RTTI})
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
message(STATUS "Disable RTTI")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
message(STATUS "Disable RTTI")
endif()
# Do not give any flags for other less widely used
# compilers
endif()
set(_SOURCE_FILES
PDGAnalyzer.cpp)
add_llvm_pass_plugin(PDGAnalyzer
${_SOURCE_FILES})