genie.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. --
  2. -- Premake 4.x build configuration script
  3. --
  4. --
  5. -- Define the project. Put the release configuration first so it will be the
  6. -- default when folks build using the makefile. That way they don't have to
  7. -- worry about the /scripts argument and all that.
  8. --
  9. premake.make.override = { "TARGET" }
  10. solution "genie"
  11. configurations {
  12. "Release",
  13. "Debug"
  14. }
  15. location (_OPTIONS["to"])
  16. project "genie"
  17. targetname "genie"
  18. language "C"
  19. kind "ConsoleApp"
  20. flags {
  21. "ExtraWarnings",
  22. "No64BitChecks",
  23. "StaticRuntime"
  24. }
  25. includedirs {
  26. "../src/host/lua-5.3.0/src"
  27. }
  28. files {
  29. "../**.lua",
  30. "../src/**.h",
  31. "../src/**.c",
  32. "../src/host/scripts.c",
  33. }
  34. excludes {
  35. "../src/premake.lua",
  36. "../src/host/lua-5.3.0/src/lua.c",
  37. "../src/host/lua-5.3.0/src/luac.c",
  38. "../src/host/lua-5.3.0/**.lua",
  39. "../src/host/lua-5.3.0/etc/*.c",
  40. }
  41. buildoptions {
  42. "-m64",
  43. }
  44. configuration "Debug"
  45. defines { "_DEBUG", "LUA_COMPAT_MODULE" }
  46. flags { "Symbols" }
  47. configuration "Release"
  48. defines { "NDEBUG", "LUA_COMPAT_MODULE" }
  49. flags { "OptimizeSize" }
  50. configuration "vs*"
  51. defines { "_CRT_SECURE_NO_WARNINGS" }
  52. configuration "windows"
  53. targetdir "../bin/windows"
  54. links { "ole32" }
  55. configuration "linux"
  56. targetdir "../bin/linux"
  57. links { "dl" }
  58. configuration "bsd"
  59. targetdir "../bin/bsd"
  60. configuration "linux or bsd"
  61. defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
  62. buildoptions { "-Wno-implicit-fallthrough" }
  63. links { "m" }
  64. linkoptions { "-rdynamic" }
  65. configuration "macosx"
  66. targetdir "../bin/darwin"
  67. defines { "LUA_USE_MACOSX" }
  68. links { "CoreServices.framework" }
  69. configuration { "macosx", "gmake" }
  70. buildoptions { "-mmacosx-version-min=10.6" }
  71. linkoptions { "-mmacosx-version-min=10.6" }
  72. configuration {}
  73. --
  74. -- A more thorough cleanup.
  75. --
  76. if _ACTION == "clean" then
  77. os.rmdir("bin")
  78. os.rmdir("build")
  79. end
  80. --
  81. -- Use the --to=path option to control where the project files get generated. I use
  82. -- this to create project files for each supported toolset, each in their own folder,
  83. -- in preparation for deployment.
  84. --
  85. newoption {
  86. trigger = "to",
  87. value = "path",
  88. description = "Set the output location for the generated files"
  89. }
  90. --
  91. -- Use the embed action to convert all of the Lua scripts into C strings, which
  92. -- can then be built into the executable. Always embed the scripts before creating
  93. -- a release build.
  94. --
  95. dofile("embed.lua")
  96. newaction {
  97. trigger = "embed",
  98. description = "Embed scripts in scripts.c; required before release builds",
  99. execute = doembed
  100. }
  101. --
  102. -- Use the release action to prepare source and binary packages for a new release.
  103. -- This action isn't complete yet; a release still requires some manual work.
  104. --
  105. dofile("release.lua")
  106. newaction {
  107. trigger = "release",
  108. description = "Prepare a new release (incomplete)",
  109. execute = dorelease
  110. }