-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·32 lines (25 loc) · 1.02 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
cmake_minimum_required(VERSION 2.8.8)
SET(CMAKE_BUILD_TYPE Debug)
project(agaLang)
set(LLVM_PATH llvm)
set(LLVM_DIR llvm/cmake/modules/CMakeFiles)
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
FILE(GLOB_RECURSE SRC_ALL "src/*.cpp")
FILE(GLOB_RECURSE INC_ALL "include/*.h")
FILE(GLOB_RECURSE LLVM_INC_ALL "llvm-3.8.0.src/include/*.h")
FILE(GLOB_RECURSE TEST_ALL "test/*.*")
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(include)
include_directories(include llvm/include llvm-3.8.0.src/include ${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
ADD_DEFINITIONS(-std=c++14 -D_DEBUG)
add_executable(agaLang ${SRC_ALL} ${INC_ALL} ${TEST_ALL})
# Find the libraries that correspond to the LLVM components
# that we wish to use
llvm_map_components_to_libnames(llvm_libs core)
#llvm_map_components_to_libnames(llvm_libs core interpreter x86codegen)
# Link against LLVM libraries
target_link_libraries(agaLang ${llvm_libs})