-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfastbuild_action.lua
120 lines (94 loc) · 2.6 KB
/
fastbuild_action.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
--
-- actions/fastbuild/fastbuild.lua
-- Extend the existing exporters with support for FASTBuild
-- Copyright (c) 2017-2017 Daniel Penkała
--
local p = premake
local fastbuild = p.fastbuild
---
-- Define a helper command that will hold available platforms
---
p.api.register {
name = "fbcompiler",
scope = "workspace",
kind = "string"
}
p.api.register {
name = "fbunitymaxfiles",
scope = "project",
kind = "number"
}
p.api.register {
name = "fbcompilers",
scope = "global",
kind = "list:keyed:string",
}
p.api.register {
name = "fbunity",
scope = "global",
kind = "keyed:mixed"
}
p.api.register {
name = "fbtag",
scope = "config",
kind = "string"
}
p.api.register {
name = "fbprebuildcommands",
scope = "config",
kind = "list:keyed:string",
tokens = true
}
newoption {
trigger = "fb-vstudio",
description = "Adds tools projects to the solution"
}
newoption {
trigger = "fb-cache-path",
description = "Sets the cache path in the Settings section which will override the ENV variable (if set)"
}
newoption {
trigger = "fb-unity-builds",
description = "Creates unity function calls and supplies the unity blobs to object lists instead of all files."
}
p.api.addAllowed("flags", "FBUnityBuild")
p.api.addAllowed("flags", "FBUnityBuildDisabled")
---
-- Define the FASTBuild export action.
---
newaction {
-- Metadata for the command line and help system
trigger = "fastbuild",
shortname = "FASTBuild ",
description = "Generate FASTBuild project files",
-- The capabilities of this action
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Makefile", "None", "Utility" },
valid_languages = { "C", "C++" },
valid_tools = { },
-- Workspace and project generation logic
onWorkspace = function(wks)
if _OPTIONS['fb-vstudio'] then
wks.vstudio_enabled = true
end
wks.fbuild = { }
fastbuild.generateSolution(wks)
end,
onProject = function(prj)
if _OPTIONS['fb-vstudio'] then
prj.vstudio_enabled = true
end
prj.fbuild = { }
fastbuild.generateProject(prj)
end,
onRule = function(rule)
fastbuild.generateRule(rule)
end,
onCleanWorkspace = function(wks)
end,
onCleanProject = function(prj)
end,
onCleanCompiler = function(cl)
end,
onCleanTarget = function(prj)
end,
}