forked from llvm-class/project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (25 loc) · 1020 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 2.8.8)
project(rift)
#SET(CMAKE_C_COMPILER "/usr/bin/clang-3.5")
#SET(CMAKE_CXX_COMPILER "/usr/bin/clang++-3.5")
# set LLVM
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
if(${CMAKE_CXX_COMPILER_ID} EQUAL "MSVC")
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
else()
add_definitions(-Wall -std=c++11 -Wno-unknown-pragmas)
endif()
# TODO for now, make all builds debug
set(CMAKE_BUILD_TYPE Debug)
# build the shared library for the JIT
file(GLOB SRC "*.cpp" "*.h" "tests/*.ri")
add_executable(${PROJECT_NAME} ${SRC})
# Find the libraries that correspond to the LLVM components
# that we wish to use
llvm_map_components_to_libnames(llvm_libs support core mcjit native irreader linker ipo executionengine runtimedyld)
# Link against LLVM libraries
target_link_libraries(${PROJECT_NAME} ${llvm_libs})