-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
52 lines (45 loc) · 1.5 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lecc)
set(CMAKE_BUILD_TYPE Debug)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ast/
${CMAKE_CURRENT_SOURCE_DIR}/parser/
${CMAKE_CURRENT_SOURCE_DIR}/execengine/
)
# Add Bison command
SET(BISON_EXECUTABLE bison)
ADD_CUSTOM_COMMAND (
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/parser/parser.y
COMMAND ${BISON_EXECUTABLE}
ARGS -d -o ${CMAKE_CURRENT_SOURCE_DIR}/parser/parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/parser.y
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/parser/parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/parser/parser.hpp
)
# Add Flex command
SET(FLEX_EXECUTABLE lex)
ADD_CUSTOM_COMMAND(
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/parser/scanner.l
COMMAND ${FLEX_EXECUTABLE}
ARGS -o ${CMAKE_CURRENT_SOURCE_DIR}/parser/scanner.cpp
${CMAKE_CURRENT_SOURCE_DIR}/parser/scanner.l
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/parser/scanner.cpp
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parser/parser.hpp
)
SET(SOURCE_FILES
ast/AST.cpp
parser/scanner.cpp
parser/parser.cpp
execengine/ExecEngine.cpp
execengine/KernelObjects.cpp
execengine/kernelobjects/Object.cpp
execengine/kernelobjects/Class.cpp
execengine/kernelobjects/DynamicObject.cpp
execengine/kernelobjects/String.cpp
execengine/kernelobjects/Character.cpp
execengine/kernelobjects/Integer.cpp
execengine/kernelobjects/Decimal.cpp
execengine/kernelobjects/Boolean.cpp
execengine/kernelobjects/Routine.cpp
)
ADD_EXECUTABLE(lecc main.cpp ${SOURCE_FILES})