_preload.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ---
  2. -- xcode/_preload.lua
  3. -- Define the Apple XCode actions and new APIs.
  4. -- Copyright (c) 2009-2015 Jason Perkins and the Premake project
  5. ---
  6. local p = premake
  7. --
  8. -- Register new Xcode-specific project fields.
  9. --
  10. p.api.register {
  11. name = "xcodebuildsettings",
  12. scope = "config",
  13. kind = "key-array",
  14. }
  15. p.api.register {
  16. name = "xcodebuildresources",
  17. scope = "config",
  18. kind = "list",
  19. }
  20. p.api.register {
  21. name = "xcodecodesigningidentity",
  22. scope = "config",
  23. kind = "string",
  24. }
  25. p.api.register {
  26. name = "xcodesystemcapabilities",
  27. scope = "project",
  28. kind = "key-boolean",
  29. }
  30. p.api.register {
  31. name = "iosfamily",
  32. scope = "config",
  33. kind = "string",
  34. allowed = {
  35. "iPhone/iPod touch",
  36. "iPad",
  37. "Universal",
  38. }
  39. }
  40. p.api.register {
  41. name = "embed",
  42. scope = "config",
  43. kind = "list",
  44. }
  45. p.api.register {
  46. name = "embedAndSign",
  47. scope = "config",
  48. kind = "list",
  49. }
  50. --
  51. -- Register the Xcode exporters.
  52. --
  53. newaction {
  54. trigger = "xcode4",
  55. shortname = "Apple Xcode 4",
  56. description = "Generate Apple Xcode 4 project files",
  57. -- Xcode always uses Mac OS X path and naming conventions
  58. toolset = "clang",
  59. -- The capabilities of this action
  60. valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib", "Makefile", "Utility", "None" },
  61. valid_languages = { "C", "C++" },
  62. valid_tools = {
  63. cc = { "gcc", "clang" },
  64. },
  65. -- Workspace and project generation logic
  66. onWorkspace = function(wks)
  67. p.generate(wks, ".xcworkspace/contents.xcworkspacedata", p.modules.xcode.generateWorkspace)
  68. end,
  69. onProject = function(prj)
  70. p.generate(prj, ".xcodeproj/project.pbxproj", p.modules.xcode.generateProject)
  71. end,
  72. }
  73. --
  74. -- Decide when the full module should be loaded.
  75. --
  76. return function(cfg)
  77. return (_ACTION == "xcode4")
  78. end