-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (55 loc) · 1.43 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
# only allow out-of-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(
FATAL_ERROR
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt."
)
endif()
cmake_minimum_required(VERSION 3.15)
# define project name and current version
project(schemecpp VERSION 0.1.0)
# link the files to be included
add_executable(scheme
src/main.cpp
src/scheme.cpp
src/memory.cpp
src/parse.cpp
src/evaluate.cpp
src/operations.cpp
src/trampoline.cpp
src/environment.cpp
src/test.cpp
src/repl.cpp
src/setup.cpp
src/garbage_collection.cpp
include/loguru.cpp
)
# tell clang to use c++17 standard
target_compile_features(scheme PRIVATE cxx_std_17)
# include header directories
target_include_directories(scheme PUBLIC src include)
# copy other files to build directory
configure_file("${CMAKE_SOURCE_DIR}/src/std.scm" "${CMAKE_BINARY_DIR}/std.scm" COPYONLY)
# set warning levels for compilation this is different for windows machines
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(
-Wall
-Wcast-align
-Wconversion
-Wdouble-promotion
-Weffc++
-Werror
-Wextra
-Wformat=2
-Wold-style-cast
-Woverload-cirtual
-Wpedantic
-Wshadow
-Wsign-conversion
-Wunused
)
endif()
target_link_libraries(scheme pthread)
target_link_libraries(scheme dl)