-
Notifications
You must be signed in to change notification settings - Fork 8
/
premake5.lua
155 lines (122 loc) · 2.94 KB
/
premake5.lua
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
-- premake5.lua project solution script
cfg_systemversion = "latest" -- "10.0.17763.0" -- To use the latest version of the SDK available
-- solution
workspace "hcc"
configurations { "Debug", "Release" }
platforms { "Win32", "Win64" }
location "build"
defines { "_CRT_SECURE_NO_WARNINGS" }
systemversion(cfg_systemversion)
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
targetsuffix("_d")
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter "platforms:Win32"
architecture "x32"
filter "platforms:Win64"
architecture "x64"
filter {}
targetdir("build/bin")
objdir("build/obj/%{prj.name}/%{cfg.buildcfg}")
debugdir ("build/..");
-- project basic
project "basic"
language "C"
kind "StaticLib"
includedirs {
"./src/basic"
}
files {
"./src/basic/*.h",
"./src/basic/*.c",
"./src/basic/*.inl"
}
-- project libcpp
project "libcpp"
language "C"
kind "StaticLib"
dependson { "basic" }
links { "basic" }
includedirs {
"./src/basic",
"./src/libcpp"
}
files {
"./src/libcpp/*.h",
"./src/libcpp/*.c"
}
-- project libcc
project "libcc"
language "C"
kind "StaticLib"
dependson { "basic" }
links { "basic" }
includedirs {
"./src/basic",
"./src/libcc"
}
files {
"./src/libcc/*.h",
"./src/libcc/*.c",
"./src/libcc/lexer/*.h",
"./src/libcc/lexer/*.c",
"./src/libcc/parser/*.h",
"./src/libcc/parser/*.c",
"./src/libcc/ir/*.h",
"./src/libcc/ir/*.c",
"./src/libcc/gen/*.h",
"./src/libcc/gen/*.c",
"./src/libcc/gen/x86/*.h",
"./src/libcc/gen/x86/*.c",
"./src/libcc/gen/x86/*.inl"
}
group "tools"
-- project hcpp
project "hcpp"
language "C"
kind "ConsoleApp"
dependson { "basic", "libcpp" }
links { "basic", "libcpp" }
debugargs { "-I dist/include -o dist/examples/helloworld_01/helloworld.i dist/examples/helloworld_01/helloworld.c" }
includedirs {
"./src/basic",
"./src/libcpp",
"./src/tools/common",
"./src/tools/hcpp"
}
files {
"./src/tools/common/*.h",
"./src/tools/common/*.c",
"./src/tools/hcpp/*.h",
"./src/tools/hcpp/*.c"
}
postbuildcommands {
-- Copy the hcpp to the dist/bin folder.
'{COPY} "%{cfg.buildtarget.abspath}" "../dist/bin"',
}
-- project hcc
project "hcc"
language "C"
kind "ConsoleApp"
dependson { "basic", "libcc" }
links { "basic", "libcc" }
debugargs { "-o dist/examples/helloworld_01/helloworld.asm dist/examples/helloworld_01/helloworld.i" }
includedirs {
"./src/basic",
"./src/libcc",
"./src/tools/common",
"./src/tools/hcc"
}
files {
"./src/tools/common/*.h",
"./src/tools/common/*.c",
"./src/tools/hcc/*.h",
"./src/tools/hcc/*.c"
}
postbuildcommands {
-- Copy the hcc to the dist/bin folder.
'{COPY} "%{cfg.buildtarget.abspath}" "../dist/bin"',
}