genie.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. newoption {
  29. trigger = "no-level-editor",
  30. description = "Do not build Level Editor."
  31. }
  32. solution "crown"
  33. configurations {
  34. "debug",
  35. "development",
  36. "release",
  37. }
  38. platforms {
  39. "x32",
  40. "x64",
  41. "native"
  42. }
  43. language "C++"
  44. configuration {}
  45. dofile ("toolchain.lua")
  46. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  47. dofile ("crown.lua")
  48. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  49. group "libs"
  50. bgfxProject("", "StaticLib", os.is("windows") and { "BGFX_CONFIG_RENDERER_DIRECT3D9=1" } or {})
  51. if _OPTIONS["with-openal"] then
  52. dofile ("openal.lua")
  53. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  54. end
  55. if _OPTIONS["with-bullet"] then
  56. dofile ("bullet.lua")
  57. end
  58. group "engine"
  59. crown_project("", "ConsoleApp", {})
  60. if _OPTIONS["with-tools"] then
  61. group "tools"
  62. if not _OPTIONS["no-level-editor"] then
  63. dofile ("level-editor.lua")
  64. end
  65. dofile ("shaderc.lua")
  66. dofile ("texturec.lua")
  67. end
  68. -- Install
  69. configuration { "x32", "linux-*" }
  70. postbuildcommands {
  71. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x86/luajit " .. CROWN_BUILD_DIR .. "linux32/bin",
  72. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "linux32/bin",
  73. }
  74. configuration { "x64", "linux-*" }
  75. postbuildcommands {
  76. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_BUILD_DIR .. "linux64/bin",
  77. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "linux64/bin",
  78. }
  79. configuration { "x32", "vs*" }
  80. postbuildcommands {
  81. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/luajit.exe " .. CROWN_BUILD_DIR .. "win32/bin",
  82. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.lib " .. CROWN_BUILD_DIR .. "win32/bin",
  83. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.exp " .. CROWN_BUILD_DIR .. "win32/bin",
  84. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x86/lua51.dll " .. CROWN_BUILD_DIR .. "win32/bin",
  85. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "win32/bin",
  86. }
  87. configuration { "x64", "vs*" }
  88. postbuildcommands {
  89. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/luajit.exe " .. CROWN_BUILD_DIR .. "win64/bin",
  90. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.lib " .. CROWN_BUILD_DIR .. "win64/bin",
  91. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.exp " .. CROWN_BUILD_DIR .. "win64/bin",
  92. "cp " .. CROWN_THIRD_DIR .. "luajit/pre/win_x64/lua51.dll " .. CROWN_BUILD_DIR .. "win64/bin",
  93. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. CROWN_BUILD_DIR .. "win64/bin",
  94. }