premake/_preload.lua

132 lines
2.4 KiB
Lua
Raw Normal View History

--
-- 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"
2015-10-15 13:05:33 +00:00
p.ANDROIDPROJ = "androidproj"
api.addAllowed("system", p.ANDROID)
2015-10-15 13:05:33 +00:00
api.addAllowed("architecture", { "armv5", "armv7", "aarach64", "mips", "mips64", "arm" })
api.addAllowed("vectorextensions", { "NEON", "MXU" })
api.addAllowed("flags", { "Thumb" })
2015-10-15 13:05:33 +00:00
api.addAllowed("kind", p.ANDROIDPROJ)
premake.action._list["vs2015"].valid_kinds = table.join(premake.action._list["vs2015"].valid_kinds, { p.ANDROIDPROJ })
2017-07-05 21:43:03 +00:00
premake.action._list["vs2017"].valid_kinds = table.join(premake.action._list["vs2017"].valid_kinds, { p.ANDROIDPROJ })
-- TODO: can I api.addAllowed() a key-value pair?
2017-07-31 23:44:44 +00:00
local os = p.option.get("os")
if os ~= nil then
2017-07-31 23:44:44 +00:00
table.insert(os.allowed, { "android", "Android" })
end
--
-- Register Android properties
--
api.register {
name = "floatabi",
scope = "config",
kind = "string",
allowed = {
"soft",
"softfp",
"hard",
},
}
api.register {
name = "androidapilevel",
scope = "config",
kind = "integer",
}
2015-10-15 13:05:33 +00:00
if _ACTION >= "vs2015" then
api.register {
name = "toolchainversion",
scope = "config",
kind = "string",
allowed = {
"4.9", -- NDK GCC versions
"3.8", -- NDK clang versions
2015-10-15 13:05:33 +00:00
},
}
else
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",
},
}
end
2015-10-15 13:05:33 +00:00
if _ACTION >= "vs2015" then
api.register {
name = "stl",
scope = "config",
kind = "string",
allowed = {
"minimal c++ (system)",
"c++ static",
"c++ shared",
"stlport static",
"stlport shared",
"gnu stl static",
"gnu stl shared",
"llvm libc++ static",
"llvm libc++ shared",
},
}
else
api.register {
name = "stl",
scope = "config",
kind = "string",
allowed = {
"none",
"minimal",
"stdc++",
"stlport",
},
}
end
api.register {
2015-10-15 13:05:33 +00:00
name = "thumbmode",
scope = "config",
kind = "string",
allowed = {
2015-10-15 13:05:33 +00:00
"thumb",
"arm",
"disabled",
},
}
2017-07-05 21:42:50 +00:00
api.register {
name = "androidapplibname",
scope = "config",
kind = "string"
}
2017-07-05 21:42:50 +00:00
return function(cfg)
return true
end