genie.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. --
  2. -- Copyright (c) 2012-2023 Daniele Bartolini et al.
  3. -- SPDX-License-Identifier: MIT
  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. newaction {
  30. trigger = "create-meson-build",
  31. description = "Create meson.build.",
  32. execute = function() dofile("scripts/create-meson-build.lua") end
  33. }
  34. solution "crown"
  35. configurations {
  36. "debug",
  37. "development",
  38. "release",
  39. }
  40. platforms {
  41. "x32",
  42. "x64",
  43. "native"
  44. }
  45. language "C++"
  46. configuration {}
  47. dofile ("toolchain.lua")
  48. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  49. dofile ("crown.lua")
  50. group "engine"
  51. crown_project("", "WindowedApp", {})
  52. group "libs"
  53. dofile (BX_DIR .. "scripts/bx.lua")
  54. dofile (BIMG_DIR .. "scripts/bimg.lua")
  55. dofile (BIMG_DIR .. "scripts/bimg_encode.lua")
  56. dofile (BIMG_DIR .. "scripts/bimg_decode.lua")
  57. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  58. if _OPTIONS["gfxapi"] == "gl32" then
  59. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGL=32")
  60. elseif _OPTIONS["gfxapi"] == "gles2" then
  61. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGLES=20")
  62. elseif _OPTIONS["gfxapi"] == "d3d11" then
  63. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_DIRECT3D11=1")
  64. else
  65. bgfxProject("", "StaticLib")
  66. end
  67. dofile ("openal.lua")
  68. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  69. dofile ("bullet.lua")
  70. if _OPTIONS["with-tools"] then
  71. group "tools"
  72. if not _OPTIONS["no-level-editor"] then
  73. dofile ("level-editor.lua")
  74. end
  75. end