-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
29 lines (20 loc) · 875 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
PROJECT(IRTestbed)
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
set(CMAKE_CXX_FLAGS_OLD ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_OLD} -fno-rtti -fpic")
FIND_PACKAGE(LLVM REQUIRED CONFIG)
include(CheckCXXCompilerFlag)
ADD_DEFINITIONS(${LLVM_DEFINITIONS})
INCLUDE_DIRECTORIES(${LLVM_INCLUDE_DIRS})
LIST(APPEND CMAKE_PROGRAM_PATH ${LLVM_ROOT_DIR})
FILE(GLOB TESTBED_SRCS "testbed.cpp")
ADD_LIBRARY(IRTestbed SHARED ${TESTBED_SRCS})
FILE(GLOB WRAPPER_SRCS "wrapper.cpp")
ADD_EXECUTABLE(tb-clang ${WRAPPER_SRCS})
TARGET_LINK_LIBRARIES(tb-clang IRTestbed ${LLVM_AVAILABLE_LIBS})
FILE(CREATE_LINK ${IRTestbed_BINARY_DIR}/tb-clang
${IRTestbed_BINARY_DIR}/tb-clang++ SYMBOLIC)
FILE(CREATE_LINK ${LLVM_TOOLS_BINARY_DIR}/clang
${IRTestbed_BINARY_DIR}/clang SYMBOLIC)
FILE(CREATE_LINK ${LLVM_TOOLS_BINARY_DIR}/clang++
${IRTestbed_BINARY_DIR}/clang++ SYMBOLIC)