forked from TurkeyMan/premake-vstool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_preload.lua
More file actions
85 lines (73 loc) · 1.4 KB
/
_preload.lua
File metadata and controls
85 lines (73 loc) · 1.4 KB
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
--
-- Name: vstool/_preload.lua
-- Purpose: Define the vs-tool API's.
-- Author: Manu Evans
-- Copyright: (c) 2013-2015 Manu Evans and the Premake project
--
local p = premake
local api = p.api
--
-- To avoid vstool.lua re-including _preload
--
p.extensions.vstool = true
--
-- Register the vs-tool module
--
api.addAllowed("architecture", { "arm" })
api.addAllowed("vectorextensions", { "MMX","SSE4","SSE4.2" })
api.addAllowed("flags", {
-- "OutputIR",
"OutputBC",
})
if not p.fields["clangpath"] then
api.register {
name = "clangpath",
scope = "config",
kind = "path",
tokens = true,
}
end
if not p.fields["mingwpath"] then
api.register {
name = "mingwpath",
scope = "config",
kind = "path",
tokens = true,
}
end
if not p.fields["staticlibformat"] then
api.register {
name = "staticlibformat",
scope = "config",
kind = "string",
allowed = {
".o",
".a",
".lib",
},
}
end
-- TODO: replace this with an agreed solution in core
api.register {
name = "languagestandard",
scope = "config",
kind = "string",
allowed = {
"c90",
"gnu90",
"c94",
"c99",
"gnu99",
"c++98",
"gnu++98",
"c++11",
"gnu++11",
"c++14",
},
}
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return _ACTION:startswith("vs") and (cfg.toolset == "gcc" or cfg.toolset == "clang")
end