-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
84 lines (72 loc) · 2.05 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.10)
project(lang_mu C)
set(CMAKE_C_STANDARD 11)
include_directories(.)
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/generated)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/generated/mu.scanner.c
COMMAND flex -o ${CMAKE_SOURCE_DIR}/generated/mu.scanner.c ${CMAKE_SOURCE_DIR}/parsing/mu.l
DEPENDS ${CMAKE_SOURCE_DIR}/parsing/mu.l
)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/generated/mu.parser.c
${CMAKE_SOURCE_DIR}/generated/mu.parser.h
${CMAKE_SOURCE_DIR}/generated/mu.parser.output
COMMAND bison -v -d -o ${CMAKE_SOURCE_DIR}/generated/mu.parser.c ${CMAKE_SOURCE_DIR}/parsing/mu.y
DEPENDS ${CMAKE_SOURCE_DIR}/parsing/mu.y
)
add_executable(lang_mu
generated/mu.scanner.c
generated/mu.parser.c
generated/mu.parser.h
parsing/stree.c
parsing/stree.h
types/longint.c
types/longint.h
types/string.c
types/string.h
utils/log.h
utils/map.c
utils/map.h
utils/strutils.c
utils/strutils.h
exec/builtin/control.c
exec/builtin/evaluation.c
exec/builtin/functions.h
exec/builtin/io.c
exec/builtin/list.c
exec/builtin/math.c
exec/builtin/predicates.c
exec/builtin/string.c
exec/exec.h
exec/types.h
exec/constructions.h
exec/constructions.c
exec/context.c
exec/context.h
exec/eval.c
exec/eval.h
exec/executor.c
exec/executor.h
exec/function.c
exec/function.h
exec/gc.c
exec/gc.h
exec/make.c
exec/make.h
exec/math.c
exec/math.h
exec/predicates.c
exec/predicates.h
main.c
parser.c
parser.h
load.c
load.h
print.c
print.h)
add_custom_command(
TARGET lang_mu POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/stdlib/stdlib.mu
${CMAKE_CURRENT_BINARY_DIR}/stdlib/stdlib.mu)