-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
63 lines (53 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
#!/usr/bin/cmake -P
cmake_minimum_required(VERSION 3.14)
project(Compiler)
# Version
# Use to set verion information
set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)
# Variables
# Set true to enable debugging
set(VERBOSITY 3)
# Language Options
# Enable data types with 1, disable with 0
set(CHAR 1)
set(STRING 1)
set(FLOAT 1)
set(DOUBLE 1)
set(INT 1)
set(LONG 1)
# Uncomment for testing
#add_compile_definitions("_TESTING")
# DO NOT TOUCH!
set(CMAKE_CXX_STANDARD 20)
# Conditional Checks
if (NOT DEFINED VERBOSITY)
set(VERBOSITY 2)
endif ()
# Program Variables
message("Project Version: " ${VERSION_MAJOR} "." ${VERSION_MINOR})
message("Verbosity Level: " ${VERBOSITY})
# Preprocesor derivitives
add_compile_definitions(_VERBOSITY=${VERBOSITY})
add_compile_definitions(_VERSION_MAJOR=${VERSION_MAJOR})
add_compile_definitions(_VERSION_MINOR=${VERSION_MINOR})
if (CHAR EQUAL 1)
add_compile_definitions(_CHAR)
endif ()
if (STRING EQUAL 1)
add_compile_definitions(_STRING)
endif ()
if (FLOAT EQUAL 1)
add_compile_definitions(_FLOAT)
endif ()
if (DOUBLE EQUAL 1)
add_compile_definitions(_DOUBLE)
endif ()
if (INT EQUAL 1)
add_compile_definitions(_INT)
endif ()
if (LONG EQUAL 1)
add_compile_definitions(_LONG)
endif ()
# Compilation of sources to object to binary
add_executable(Compiler main.cpp AST/Token.cpp AST/Token.h Scanner.cpp Scanner.h Parser.cpp Parser.h AST/AST.h AST/Operate.cpp AST/Operate.h AST/Expression.cpp AST/Expression.h AST/PrimaryExpression_Expression.cpp AST/PrimaryExpression_Expression.h AST/Terminal.cpp AST/Terminal.h AST/Identifier.cpp AST/Identifier.h AST/AST.cpp AST/Program.cpp AST/Program.h AST/Command.cpp AST/Command.h AST/CommandIf.cpp AST/CommandIf.h AST/CommandAssign.cpp AST/CommandAssign.h AST/CommandLet.cpp AST/CommandLet.h AST/Declaration.cpp AST/Declaration.h AST/DeclarationConst.cpp AST/DeclarationConst.h AST/DeclarationVar.cpp AST/DeclarationVar.h AST/TypeDenoter.cpp AST/TypeDenoter.h AST/VarName.cpp AST/VarName.h AST/PrimaryExpressionVar.cpp AST/PrimaryExpressionVar.h AST/PrimaryExpression.cpp AST/PrimaryExpression.h)