crown.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. --
  2. -- Copyright (c) 2012-2021 Daniele Bartolini et al.
  3. -- License: https://github.com/dbartolini/crown/blob/master/LICENSE
  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 or development" }
  42. defines {
  43. "CROWN_DEBUG=1"
  44. }
  45. configuration { "development" }
  46. defines {
  47. "CROWN_DEVELOPMENT=1"
  48. }
  49. configuration { "android*" }
  50. kind "ConsoleApp"
  51. targetextension ".so"
  52. linkoptions {
  53. "-shared"
  54. }
  55. links {
  56. "gcc",
  57. "EGL",
  58. "GLESv2",
  59. "OpenSLES",
  60. }
  61. configuration { "linux-*" }
  62. links {
  63. "X11",
  64. "Xrandr",
  65. "pthread",
  66. "GL",
  67. }
  68. configuration { "vs* or mingw*" }
  69. links {
  70. "dbghelp",
  71. "xinput",
  72. "psapi",
  73. "ws2_32",
  74. "ole32",
  75. "gdi32",
  76. }
  77. configuration {}
  78. files {
  79. CROWN_DIR .. "src/**.h",
  80. CROWN_DIR .. "src/**.cpp"
  81. }
  82. strip()
  83. configuration {} -- reset configuration
  84. end