genie.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --
  2. -- Copyright (c) 2012-2020 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/dbartolini/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. BIMG_DIR = (CROWN_DIR .. "3rdparty/bimg/")
  10. BX_DIR = (CROWN_DIR .. "3rdparty/bx/")
  11. function copyLib()
  12. end
  13. newoption {
  14. trigger = "with-luajit",
  15. description = "Build with luajit support."
  16. }
  17. newoption {
  18. trigger = "with-tools",
  19. description = "Build with tools."
  20. }
  21. newoption {
  22. trigger = "no-level-editor",
  23. description = "Do not build Level Editor."
  24. }
  25. newoption {
  26. trigger = "gfxapi",
  27. description = "BGFX renderer (gl32, gles2, d3d11)."
  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. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  44. dofile ("crown.lua")
  45. group "engine"
  46. crown_project("", "WindowedApp", {})
  47. group "libs"
  48. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  49. if _OPTIONS["gfxapi"] == "gl32" then
  50. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGL=32")
  51. elseif _OPTIONS["gfxapi"] == "gles2" then
  52. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGLES=20")
  53. elseif _OPTIONS["gfxapi"] == "d3d11" then
  54. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_DIRECT3D11=1")
  55. else
  56. bgfxProject("", "StaticLib")
  57. end
  58. dofile (BX_DIR .. "scripts/bx.lua")
  59. dofile (BIMG_DIR .. "scripts/bimg.lua")
  60. dofile (BIMG_DIR .. "scripts/bimg_encode.lua")
  61. dofile (BIMG_DIR .. "scripts/bimg_decode.lua")
  62. dofile ("openal.lua")
  63. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  64. dofile ("bullet.lua")
  65. if _OPTIONS["with-tools"] then
  66. group "tools"
  67. if not _OPTIONS["no-level-editor"] then
  68. dofile ("level-editor.lua")
  69. end
  70. dofile ("level-editor-imgui.lua")
  71. end