crown.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 not _OPTIONS["no-lua"] then
  28. if not _OPTIONS["no-luajit"] then
  29. includedirs {
  30. CROWN_DIR .. "3rdparty/luajit/src",
  31. }
  32. configuration { "not vs*" }
  33. links {
  34. "luajit"
  35. }
  36. configuration { "vs*"}
  37. links {
  38. "lua51"
  39. }
  40. configuration {}
  41. else
  42. includedirs {
  43. CROWN_DIR .. "3rdparty/lua/src",
  44. }
  45. links { "lua" }
  46. defines {
  47. "CROWN_USE_LUAJIT=0",
  48. }
  49. end
  50. end
  51. configuration { "debug" }
  52. defines {
  53. "BX_CONFIG_DEBUG=1",
  54. }
  55. configuration { "debug or development" }
  56. defines {
  57. "CROWN_DEBUG=1"
  58. }
  59. configuration { "development" }
  60. defines {
  61. "CROWN_DEVELOPMENT=1"
  62. }
  63. configuration { "release or development" }
  64. defines {
  65. "BX_CONFIG_DEBUG=0",
  66. }
  67. configuration { "android*" }
  68. kind "ConsoleApp"
  69. targetextension ".so"
  70. linkoptions {
  71. "-shared"
  72. }
  73. links {
  74. "gcc",
  75. "EGL",
  76. "GLESv2",
  77. "OpenSLES",
  78. }
  79. configuration { "linux-*" }
  80. links {
  81. "X11",
  82. "Xrandr",
  83. "pthread",
  84. "GL",
  85. }
  86. configuration { "vs* or mingw*" }
  87. links {
  88. "dbghelp",
  89. "xinput",
  90. "psapi",
  91. "ws2_32",
  92. "ole32",
  93. "gdi32",
  94. }
  95. configuration {}
  96. files {
  97. CROWN_DIR .. "src/**.h",
  98. CROWN_DIR .. "src/**.cpp"
  99. }
  100. strip()
  101. configuration {} -- reset configuration
  102. end