genie.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --
  2. -- Copyright (c) 2012-2025 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 = "no-lua",
  15. description = "Build without Lua scripting."
  16. }
  17. newoption {
  18. trigger = "no-luajit",
  19. description = "Build with regular Lua."
  20. }
  21. newoption {
  22. trigger = "with-tools",
  23. description = "Build with tools."
  24. }
  25. newoption {
  26. trigger = "no-editor",
  27. description = "Do not build the Editor."
  28. }
  29. newoption {
  30. trigger = "gfxapi",
  31. description = "BGFX renderer (gl32, gles3, 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 (BX_DIR .. "scripts/bx.lua")
  53. dofile (BIMG_DIR .. "scripts/bimg.lua")
  54. dofile (BIMG_DIR .. "scripts/bimg_encode.lua")
  55. dofile (BIMG_DIR .. "scripts/bimg_decode.lua")
  56. dofile (BGFX_DIR .. "scripts/bgfx.lua")
  57. if _OPTIONS["gfxapi"] == "gl32" then
  58. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGL=32")
  59. elseif _OPTIONS["gfxapi"] == "gles3" then
  60. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_OPENGLES=30")
  61. elseif _OPTIONS["gfxapi"] == "d3d11" then
  62. bgfxProject("", "StaticLib", "BGFX_CONFIG_RENDERER_DIRECT3D11=1")
  63. else
  64. bgfxProject("", "StaticLib")
  65. end
  66. dofile ("openal.lua")
  67. openal_project(os.is("windows") and "SharedLib" or "StaticLib")
  68. dofile ("bullet.lua")
  69. dofile ("lua.lua")
  70. dofile ("luac.lua")
  71. if _OPTIONS["with-tools"] then
  72. group "tools"
  73. if not _OPTIONS["no-editor"] then
  74. dofile ("crown-editor.lua")
  75. dofile ("crown-launcher.lua")
  76. end
  77. end