genie.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 = "with-level-editor-imgui",
  27. description = "Build with Level Editor (IMGUI)."
  28. }
  29. newoption {
  30. trigger = "gfxapi",
  31. description = "BGFX renderer (gl32, gles2, d3d11)."
  32. }
  33. solution "crown"
  34. configurations {
  35. "debug",
  36. "development",
  37. "release",
  38. }
  39. platforms {
  40. "x32",
  41. "x64",
  42. "native"
  43. }
  44. language "C++"
  45. configuration {}
  46. dofile ("toolchain.lua")
  47. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  48. dofile ("crown.lua")
  49. group "engine"
  50. crown_project("", "WindowedApp", {})
  51. group "libs"
  52. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  53. if _OPTIONS["gfxapi"] == "gl32" then
  54. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGL=32")
  55. elseif _OPTIONS["gfxapi"] == "gles2" then
  56. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGLES=20")
  57. elseif _OPTIONS["gfxapi"] == "d3d11" then
  58. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_DIRECT3D11=1")
  59. else
  60. bgfxProject("", "StaticLib")
  61. end
  62. dofile (BX_DIR .. "scripts/bx.lua")
  63. dofile (BIMG_DIR .. "scripts/bimg.lua")
  64. dofile (BIMG_DIR .. "scripts/bimg_encode.lua")
  65. dofile (BIMG_DIR .. "scripts/bimg_decode.lua")
  66. dofile ("openal.lua")
  67. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  68. dofile ("bullet.lua")
  69. if _OPTIONS["with-tools"] then
  70. group "tools"
  71. if not _OPTIONS["no-level-editor"] then
  72. dofile ("level-editor.lua")
  73. end
  74. if _OPTIONS["with-level-editor-imgui"] then
  75. dofile ("level-editor-imgui.lua")
  76. end
  77. end