-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
64 lines (56 loc) · 1.63 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
-- The _ACTION variable can be null, which will be annoying.
-- Let's make a action that won't be null
action = _ACTION or ""
-- New option to control if the chirp library should be built
-- as a shared or static library
newoption {
trigger = "shared",
description = "Generate projects for shared library (default: no)",
value = "yes/no",
allowed = {
{ "yes", "Shared library" },
{ "no", "Static library" }
}
}
-- The test solution
solution "chirp"
location ( "build/" .. action )
configurations { "debug", "release" }
warnings "Extra"
flags { "FatalWarnings" }
cppdialect "C++14"
-- Add some flags for gmake builds
if _ACTION == "gmake" then
buildoptions { "-Wall" }
end
-- Provide a default for the "shared" option
if not _OPTIONS["shared"] then
_OPTIONS["shared"] = "no"
end
-- Since premake doesn't implement the clean command
-- on all platforms, we define our own
if action == "clean" then
os.rmdir("build")
os.rmdir("bin")
os.rmdir("lib")
end
-- Debug configuration
filter { "debug" }
targetdir ( "bin/" .. action .. "/debug" )
defines { "_DEBUG", "DEBUG" }
characterset ("Unicode")
symbols "On"
libdirs { "lib/" .. action .. "/debug" }
filter {}
-- Release configuration
filter { "release" }
targetdir ( "bin/" .. action .. "/release" )
optimize ( "Full" )
defines { "NDEBUG" }
characterset ("Unicode")
libdirs { "lib/" .. action .. "/release" }
filter {}
-- Include the solution projects
include "tests"
include "chirp"
include "examples"