genie.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --
  2. -- Copyright (c) 2012-2017 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. --
  5. CROWN_DIR = (path.getabsolute("..") .. "/")
  6. local CROWN_THIRD_DIR = (CROWN_DIR .. "3rdparty/")
  7. local CROWN_BUILD_DIR = (CROWN_DIR .. "build/")
  8. local CROWN_ENGINE_DIR = (CROWN_BUILD_DIR .. "engine/")
  9. BGFX_DIR = (CROWN_DIR .. "3rdparty/bgfx/")
  10. BX_DIR = (CROWN_DIR .. "3rdparty/bx/")
  11. function copyLib()
  12. end
  13. newoption {
  14. trigger = "with-openal",
  15. description = "Build with OpenAL support."
  16. }
  17. newoption {
  18. trigger = "with-luajit",
  19. description = "Build with luajit support."
  20. }
  21. newoption {
  22. trigger = "with-bullet",
  23. description = "Build with Bullet support."
  24. }
  25. newoption {
  26. trigger = "with-tools",
  27. description = "Build with tools."
  28. }
  29. solution "crown"
  30. configurations {
  31. "debug",
  32. "development",
  33. "release",
  34. }
  35. platforms {
  36. "x32",
  37. "x64",
  38. "native"
  39. }
  40. language "C++"
  41. configuration {}
  42. dofile ("toolchain.lua")
  43. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  44. dofile ("crown.lua")
  45. toolchain(CROWN_ENGINE_DIR, CROWN_THIRD_DIR)
  46. group "libs"
  47. bgfxProject("", "StaticLib", os.is("windows") and { "BGFX_CONFIG_RENDERER_DIRECT3D9=1" } or {})
  48. if _OPTIONS["with-openal"] then
  49. dofile ("openal.lua")
  50. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  51. end
  52. if _OPTIONS["with-bullet"] then
  53. dofile ("bullet.lua")
  54. end
  55. group "engine"
  56. crown_project("", "ConsoleApp", {})
  57. if _OPTIONS["with-tools"] then
  58. group "tools"
  59. dofile ("shaderc.lua")
  60. dofile ("texturec.lua")
  61. end
  62. -- Install
  63. configuration { "x32", "linux-*" }
  64. postbuildcommands {
  65. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x86/luajit " .. CROWN_ENGINE_DIR .. "linux32/bin",
  66. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_ENGINE_DIR .. "linux32/bin",
  67. }
  68. configuration { "x64", "linux-*" }
  69. postbuildcommands {
  70. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_ENGINE_DIR .. "linux64/bin",
  71. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_ENGINE_DIR .. "linux64/bin",
  72. }
  73. configuration { "x32", "vs*" }
  74. postbuildcommands {
  75. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/luajit.exe " .. CROWN_ENGINE_DIR .. "win32/bin",
  76. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.lib " .. CROWN_ENGINE_DIR .. "win32/bin",
  77. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.exp " .. CROWN_ENGINE_DIR .. "win32/bin",
  78. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.dll " .. CROWN_ENGINE_DIR .. "win32/bin",
  79. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_ENGINE_DIR .. "win32/bin",
  80. }
  81. configuration { "x64", "vs*" }
  82. postbuildcommands {
  83. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/luajit.exe " .. CROWN_ENGINE_DIR .. "win64/bin",
  84. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.lib " .. CROWN_ENGINE_DIR .. "win64/bin",
  85. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.exp " .. CROWN_ENGINE_DIR .. "win64/bin",
  86. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.dll " .. CROWN_ENGINE_DIR .. "win64/bin",
  87. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_ENGINE_DIR .. "win64/bin",
  88. }