_preload.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --
  2. -- Name: android/_preload.lua
  3. -- Purpose: Define the Android API's.
  4. -- Author: Manu Evans
  5. -- Copyright: (c) 2013-2015 Manu Evans and the Premake project
  6. --
  7. local p = premake
  8. local api = p.api
  9. --
  10. -- Register the Android extension
  11. --
  12. api.addAllowed("system", p.ANDROID)
  13. api.addAllowed("architecture", { "armv5", "armv7", "aarch64", "mips", "mips64", "arm" })
  14. api.addAllowed("vectorextensions", { "NEON", "MXU" })
  15. api.addAllowed("exceptionhandling", {"UnwindTables"})
  16. api.addAllowed("flags", { "Thumb" })
  17. api.addAllowed("kind", p.PACKAGING)
  18. premake.action._list["vs2015"].valid_kinds = table.join(premake.action._list["vs2015"].valid_kinds, { p.PACKAGING })
  19. premake.action._list["vs2017"].valid_kinds = table.join(premake.action._list["vs2017"].valid_kinds, { p.PACKAGING })
  20. premake.action._list["vs2019"].valid_kinds = table.join(premake.action._list["vs2019"].valid_kinds, { p.PACKAGING })
  21. local osoption = p.option.get("os")
  22. if osoption ~= nil then
  23. table.insert(osoption.allowed, { "android", "Android" })
  24. end
  25. -- add system tags for android.
  26. os.systemTags[p.ANDROID] = { "android", "mobile" }
  27. --
  28. -- Register Android properties
  29. --
  30. api.register {
  31. name = "floatabi",
  32. scope = "config",
  33. kind = "string",
  34. allowed = {
  35. "soft",
  36. "softfp",
  37. "hard",
  38. },
  39. }
  40. api.register {
  41. name = "androidapilevel",
  42. scope = "config",
  43. kind = "integer",
  44. }
  45. api.register {
  46. name = "toolchainversion",
  47. scope = "config",
  48. kind = "string",
  49. allowed = {
  50. "4.6", -- NDK GCC versions
  51. "4.8",
  52. "4.9",
  53. "3.4", -- NDK clang versions
  54. "3.5",
  55. "3.6",
  56. "3.8",
  57. "5.0",
  58. },
  59. }
  60. api.register {
  61. name = "stl",
  62. scope = "config",
  63. kind = "string",
  64. allowed = {
  65. "none",
  66. "gabi++",
  67. "stlport",
  68. "gnu",
  69. "libc++",
  70. },
  71. }
  72. api.register {
  73. name = "thumbmode",
  74. scope = "config",
  75. kind = "string",
  76. allowed = {
  77. "thumb",
  78. "arm",
  79. "disabled",
  80. },
  81. }
  82. api.register {
  83. name = "androidapplibname",
  84. scope = "config",
  85. kind = "string"
  86. }
  87. return function(cfg)
  88. return (cfg.system == p.ANDROID)
  89. end