crown.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. --
  2. -- Copyright (c) 2012-2023 Daniele Bartolini et al.
  3. -- SPDX-License-Identifier: MIT
  4. --
  5. function crown_project(_name, _kind, _defines)
  6. project ("crown" .. _name)
  7. kind (_kind)
  8. includedirs {
  9. CROWN_DIR .. "src",
  10. CROWN_DIR .. "3rdparty/bgfx/include",
  11. CROWN_DIR .. "3rdparty/bgfx/src",
  12. CROWN_DIR .. "3rdparty/bx/include",
  13. CROWN_DIR .. "3rdparty/stb",
  14. CROWN_DIR .. "3rdparty/bullet3/src",
  15. CROWN_DIR .. "3rdparty/openal/include",
  16. }
  17. defines {
  18. _defines,
  19. }
  20. links {
  21. "bgfx",
  22. "bimg",
  23. "bx",
  24. "bullet",
  25. "openal",
  26. }
  27. if _OPTIONS["with-luajit"] then
  28. includedirs {
  29. CROWN_DIR .. "3rdparty/luajit/src",
  30. }
  31. configuration { "not vs*" }
  32. links {
  33. "luajit"
  34. }
  35. configuration { "vs*"}
  36. links {
  37. "lua51"
  38. }
  39. configuration {}
  40. end
  41. configuration { "debug" }
  42. defines {
  43. "BX_CONFIG_DEBUG=1",
  44. }
  45. configuration { "debug or development" }
  46. defines {
  47. "CROWN_DEBUG=1"
  48. }
  49. configuration { "development" }
  50. defines {
  51. "CROWN_DEVELOPMENT=1"
  52. }
  53. configuration { "release or development" }
  54. defines {
  55. "BX_CONFIG_DEBUG=0",
  56. }
  57. configuration { "android*" }
  58. kind "ConsoleApp"
  59. targetextension ".so"
  60. linkoptions {
  61. "-shared"
  62. }
  63. links {
  64. "gcc",
  65. "EGL",
  66. "GLESv2",
  67. "OpenSLES",
  68. }
  69. configuration { "linux-*" }
  70. links {
  71. "X11",
  72. "Xrandr",
  73. "pthread",
  74. "GL",
  75. }
  76. configuration { "vs* or mingw*" }
  77. links {
  78. "dbghelp",
  79. "xinput",
  80. "psapi",
  81. "ws2_32",
  82. "ole32",
  83. "gdi32",
  84. }
  85. configuration {}
  86. files {
  87. CROWN_DIR .. "src/**.h",
  88. CROWN_DIR .. "src/**.cpp"
  89. }
  90. strip()
  91. configuration {} -- reset configuration
  92. end