-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (58 loc) · 2.04 KB
/
CMakeLists.txt
File metadata and controls
74 lines (58 loc) · 2.04 KB
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
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.10)
project(bread-crumbs LANGUAGES C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(${CMAKE_SOURCE_DIR}/include)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c11 -g -DDEBUG")
set(CORE_SRC
src/core/ds/arena.c
src/core/ds/hashmap.c
src/core/ds/strings.c
src/core/lang/filesystem.c
src/core/lang/source.c
src/core/lang/resolver.c
src/core/lang/diagnostic.c
)
set(FRONTEND_SRC
src/compiler/frontend/lexer/tokens.c
src/compiler/frontend/lexer.c
src/compiler/frontend/ast.c
src/compiler/frontend/parser.c
src/compiler/frontend/semantic/types.c
src/compiler/frontend/semantic/symbol.c
src/compiler/frontend/semantic.c
)
set(BACKEND_SRC
src/compiler/backend/vm/core.c
src/compiler/backend/vm/bytecode.c
src/compiler/backend/vm/runtime.c
src/compiler/backend/vm/memory.c
src/compiler/backend/jit/core.c
src/compiler/backend/jit/runtime.c
src/compiler/backend/native/core.c
src/compiler/backend/native/object.c
)
set(MIDDLE_SRC
src/compiler/middle/ir.c
src/compiler/middle/builder.c
src/compiler/middle/optimizer.c
)
set(RUNTIME_SRC
src/runtime/ffi.c
src/runtime/memory.c
src/runtime/gc.c
src/runtime/profiler.c
)
add_library(core_lib STATIC ${CORE_SRC})
add_library(frontend_lib STATIC ${FRONTEND_SRC})
add_library(runtime_lib STATIC ${RUNTIME_SRC})
add_library(compiler_lib STATIC ${MIDDLE_SRC} ${BACKEND_SRC})
target_link_libraries(compiler_lib PRIVATE core_lib frontend_lib runtime_lib)
add_executable(crum src/main.c)
target_link_libraries(crum PRIVATE compiler_lib runtime_lib)
add_executable(lexing test/integration/lexing.c)
target_link_libraries(lexing PRIVATE core_lib frontend_lib runtime_lib)
add_executable(parsing test/integration/parsing.c)
target_link_libraries(parsing PRIVATE core_lib frontend_lib runtime_lib)
add_executable(analysis test/integration/analisis.c)
target_link_libraries(analysis PRIVATE core_lib frontend_lib runtime_lib)
install(TARGETS crum DESTINATION /usr/local/bin)