-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (54 loc) · 1.36 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Base project setup.
project(vanilla)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Switch to C++11 mode.
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_definitions("-std=c++11")
endif()
# Find required libraries.
find_package(LibFFI REQUIRED)
find_package(GMP REQUIRED)
find_package(Boost REQUIRED)
# Set OS specific libraries.
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(OS_LIBS "dl")
endif()
# Set include directories.
include_directories(
./include
${LIBFFI_INCLUDE_DIRS}
${GMP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
# Set libraries.
set(LIBS
${OS_LIBS}
${LIBFFI_LIBRARIES}
${GMP_LIBRARIES}
${Boost_LIBRARIES}
)
# Set definitions.
add_definitions("${LIBFFI_DEFINITIONS}")
add_executable(vanilla
main.cpp
src/scanner.cpp
src/parsing.cpp
src/ast_base.cpp
src/expression_ast.cpp
src/statement_ast.cpp
src/context.cpp
src/native_library_cache.cpp
src/object.cpp
src/none_object.cpp
src/int_object.cpp
src/float_object.cpp
src/bool_object.cpp
src/string_object.cpp
src/array_object.cpp
src/function_object.cpp
src/native_function_object.cpp
src/gen/xml.cpp
)
target_link_libraries(vanilla ${LIBS})
install(TARGETS vanilla RUNTIME DESTINATION bin)