forked from premake/premake-android
-
Notifications
You must be signed in to change notification settings - Fork 3
/
_preload.lua
108 lines (93 loc) · 2.03 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
--
-- Name: android/_preload.lua
-- Purpose: Define the Android API's.
-- Author: Manu Evans
-- Copyright: (c) 2013-2015 Manu Evans and the Premake project
--
local p = premake
local api = p.api
--
-- Register the Android extension
--
p.ANDROID = "android"
p.ANDROIDPROJ = "androidproj"
api.addAllowed("system", p.ANDROID)
api.addAllowed("architecture", { "armv5", "armv7", "aarach64", "mips", "mips64", "arm" })
api.addAllowed("vectorextensions", { "NEON", "MXU" })
api.addAllowed("flags", { "Thumb" })
api.addAllowed("kind", p.ANDROIDPROJ)
premake.action._list["vs2015"].valid_kinds = table.join(premake.action._list["vs2015"].valid_kinds, { p.ANDROIDPROJ })
premake.action._list["vs2017"].valid_kinds = table.join(premake.action._list["vs2017"].valid_kinds, { p.ANDROIDPROJ })
local osoption = p.option.get("os")
if osoption ~= nil then
table.insert(osoption.allowed, { "android", "Android" })
end
-- add system tags for android.
os.systemTags[p.ANDROID] = { "android", "mobile" }
--
-- Register Android properties
--
api.register {
name = "floatabi",
scope = "config",
kind = "string",
allowed = {
"soft",
"softfp",
"hard",
},
}
api.register {
name = "androidapilevel",
scope = "config",
kind = "integer",
}
api.register {
name = "toolchainversion",
scope = "config",
kind = "string",
allowed = {
"4.6", -- NDK GCC versions
"4.8",
"4.9",
"3.4", -- NDK clang versions
"3.5",
"3.6",
"3.8",
},
}
api.register {
name = "stl",
scope = "config",
kind = "string",
allowed = {
"none",
"minimal c++ (system)",
"c++ static",
"c++ shared",
"stlport static",
"stlport shared",
"gnu stl static",
"gnu stl shared",
"llvm libc++ static",
"llvm libc++ shared",
},
}
api.register {
name = "thumbmode",
scope = "config",
kind = "string",
allowed = {
"thumb",
"arm",
"disabled",
},
}
api.register {
name = "androidapplibname",
scope = "config",
kind = "string"
}
return function(cfg)
return true
end