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. BGFX_DIR = (CROWN_DIR .. "3rdparty/bgfx/")
  9. BX_DIR = (CROWN_DIR .. "3rdparty/bx/")
  10. function copyLib()
  11. end
  12. newoption {
  13. trigger = "with-openal",
  14. description = "Build with OpenAL support."
  15. }
  16. newoption {
  17. trigger = "with-luajit",
  18. description = "Build with luajit support."
  19. }
  20. newoption {
  21. trigger = "with-bullet",
  22. description = "Build with Bullet support."
  23. }
  24. newoption {
  25. trigger = "with-tools",
  26. description = "Build with tools."
  27. }
  28. solution "crown"
  29. configurations {
  30. "debug",
  31. "development",
  32. "release",
  33. }
  34. platforms {
  35. "x32",
  36. "x64",
  37. "native"
  38. }
  39. language "C++"
  40. configuration {}
  41. dofile ("toolchain.lua")
  42. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  43. dofile ("crown.lua")
  44. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  45. group "libs"
  46. bgfxProject("", "StaticLib", os.is("windows") and { "BGFX_CONFIG_RENDERER_DIRECT3D9=1" } or {})
  47. if _OPTIONS["with-openal"] then
  48. dofile ("openal.lua")
  49. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  50. end
  51. if _OPTIONS["with-bullet"] then
  52. dofile ("bullet.lua")
  53. end
  54. group "engine"
  55. crown_project("", "ConsoleApp", {})
  56. if _OPTIONS["with-tools"] then
  57. group "tools"
  58. dofile ("level-editor.lua")
  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_BUILD_DIR .. "linux32/bin",
  66. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "linux32/bin",
  67. }
  68. configuration { "x64", "linux-*" }
  69. postbuildcommands {
  70. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_BUILD_DIR .. "linux64/bin",
  71. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "linux64/bin",
  72. }
  73. configuration { "x32", "vs*" }
  74. postbuildcommands {
  75. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/luajit.exe " .. CROWN_BUILD_DIR .. "win32/bin",
  76. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.lib " .. CROWN_BUILD_DIR .. "win32/bin",
  77. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.exp " .. CROWN_BUILD_DIR .. "win32/bin",
  78. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.dll " .. CROWN_BUILD_DIR .. "win32/bin",
  79. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "win32/bin",
  80. }
  81. configuration { "x64", "vs*" }
  82. postbuildcommands {
  83. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/luajit.exe " .. CROWN_BUILD_DIR .. "win64/bin",
  84. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.lib " .. CROWN_BUILD_DIR .. "win64/bin",
  85. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.exp " .. CROWN_BUILD_DIR .. "win64/bin",
  86. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.dll " .. CROWN_BUILD_DIR .. "win64/bin",
  87. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "win64/bin",
  88. }