1
0

premake4.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --
  2. -- Premake 5.x build configuration script
  3. -- Use this script to configure the project with Premake4.
  4. --
  5. --
  6. -- Define the project. Put the release configuration first so it will be the
  7. -- default when folks build using the makefile. That way they don't have to
  8. -- worry about the /scripts argument and all that.
  9. --
  10. solution "Premake5"
  11. configurations { "Release", "Debug" }
  12. location ( _OPTIONS["to"] )
  13. project "Premake5"
  14. targetname "premake5"
  15. language "C"
  16. kind "ConsoleApp"
  17. defines { "PREMAKE_NO_BUILTIN_SCRIPTS" }
  18. flags { "No64BitChecks", "ExtraWarnings", "StaticRuntime" }
  19. includedirs { "contrib/lua/src", "contrib/luashim" }
  20. files
  21. {
  22. "*.txt", "**.lua",
  23. "contrib/lua/src/*.c", "contrib/lua/src/*.h",
  24. "src/host/*.c"
  25. }
  26. excludes
  27. {
  28. "contrib/lua/src/lauxlib.c",
  29. "contrib/lua/src/lua.c",
  30. "contrib/lua/src/luac.c",
  31. "contrib/lua/src/print.c",
  32. "contrib/lua/**.lua",
  33. "contrib/lua/etc/*.c"
  34. }
  35. configuration "Debug"
  36. targetdir "bin/debug"
  37. defines "_DEBUG"
  38. flags { "Symbols" }
  39. configuration "Release"
  40. targetdir "bin/release"
  41. defines "NDEBUG"
  42. flags { "OptimizeSize" }
  43. configuration "vs*"
  44. defines { "_CRT_SECURE_NO_WARNINGS" }
  45. configuration "vs2005"
  46. defines {"_CRT_SECURE_NO_DEPRECATE" }
  47. configuration "windows"
  48. links { "ole32", "advapi32" }
  49. configuration "linux or bsd or hurd"
  50. defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
  51. links { "m" }
  52. linkoptions { "-rdynamic" }
  53. configuration "linux or hurd"
  54. links { "dl", "rt" }
  55. configuration "macosx"
  56. defines { "LUA_USE_MACOSX" }
  57. links { "CoreServices.framework" }
  58. configuration { "macosx", "gmake" }
  59. -- toolset "clang" (not until a 5.0 binary is available)
  60. buildoptions { "-mmacosx-version-min=10.4" }
  61. linkoptions { "-mmacosx-version-min=10.4" }
  62. configuration { "solaris" }
  63. links { "m", "socket", "nsl" }
  64. configuration "aix"
  65. defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
  66. links { "m" }
  67. --
  68. -- A more thorough cleanup.
  69. --
  70. if _ACTION == "clean" then
  71. os.rmdir("bin")
  72. os.rmdir("build")
  73. end
  74. --
  75. -- Use the --to=path option to control where the project files get generated. I use
  76. -- this to create project files for each supported toolset, each in their own folder,
  77. -- in preparation for deployment.
  78. --
  79. newoption {
  80. trigger = "to",
  81. value = "path",
  82. description = "Set the output location for the generated files"
  83. }
  84. --
  85. -- This new embed action is slightly hardcoded for the 4.x executable, and is
  86. -- really only intended to get folks bootstrapped on to 5.x
  87. --
  88. newaction {
  89. trigger = "embed",
  90. description = "Embed scripts in scripts.c; required before release builds",
  91. execute = function ()
  92. _MAIN_SCRIPT_DIR = os.getcwd()
  93. _SCRIPT_DIR = path.join(_MAIN_SCRIPT_DIR, "scripts")
  94. dofile("scripts/embed.lua")
  95. end
  96. }