This repository has been archived by the owner on Jun 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path_preload.lua
126 lines (106 loc) · 2.1 KB
/
_preload.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
--
-- Name: d/_preload.lua
-- Purpose: Define the D language API's.
-- Author: Manu Evans
-- Created: 2013/10/28
-- Copyright: (c) 2013-2015 Manu Evans and the Premake project
--
-- TODO:
-- MonoDevelop/Xamarin Studio has 'workspaces', which correspond to collections
-- of Premake workspaces. If premake supports multiple workspaces, we should
-- write out a workspace file...
local p = premake
local api = p.api
--
-- Register the D extension
--
p.D = "D"
api.addAllowed("language", p.D)
api.addAllowed("floatingpoint", "None")
api.addAllowed("flags", {
"CodeCoverage",
"Deprecated",
"Documentation",
"GenerateHeader",
"GenerateJSON",
"GenerateMap",
"NoBoundsCheck",
-- "PIC", // Note: this should be supported elsewhere...
"Profile",
"Quiet",
-- "Release", // Note: We infer this flag from config.isDebugBuild()
"RetainPaths",
"SeparateCompilation",
"SymbolsLikeC",
"UnitTest",
"Verbose",
})
--
-- Register some D specific properties
--
api.register {
name = "versionconstants",
scope = "config",
kind = "list:string",
tokens = true,
}
api.register {
name = "versionlevel",
scope = "config",
kind = "integer",
}
api.register {
name = "debugconstants",
scope = "config",
kind = "list:string",
tokens = true,
}
api.register {
name = "debuglevel",
scope = "config",
kind = "integer",
}
api.register {
name = "docdir",
scope = "config",
kind = "path",
tokens = true,
}
api.register {
name = "docname",
scope = "config",
kind = "string",
tokens = true,
}
api.register {
name = "headerdir",
scope = "config",
kind = "path",
tokens = true,
}
api.register {
name = "headername",
scope = "config",
kind = "string",
tokens = true,
}
--
-- Provide information for the help output
--
newoption
{
trigger = "dc",
value = "VALUE",
description = "Choose a D compiler",
allowed = {
{ "dmd", "Digital Mars (dmd)" },
{ "gdc", "GNU GDC (gdc)" },
{ "ldc", "LLVM LDC (ldc2)" },
}
}
--
-- Decide when to load the full module
--
return function (cfg)
return (cfg.language == p.D)
end