crown.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. --
  2. -- Copyright (c) 2012-2018 Daniele Bartolini and individual contributors.
  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/bx/include",
  12. CROWN_DIR .. "3rdparty/stb",
  13. }
  14. defines {
  15. _defines,
  16. }
  17. links {
  18. "bgfx",
  19. "bimg",
  20. "bx",
  21. }
  22. if _OPTIONS["with-luajit"] then
  23. includedirs {
  24. CROWN_DIR .. "3rdparty/luajit/src",
  25. }
  26. configuration { "not vs*" }
  27. links {
  28. "luajit"
  29. }
  30. configuration { "vs*"}
  31. links {
  32. "lua51"
  33. }
  34. configuration { "x32", "vs*" }
  35. libdirs {
  36. CROWN_DIR .. "3rdparty/luajit/pre/win_x32"
  37. }
  38. configuration { "x64", "vs*" }
  39. libdirs {
  40. CROWN_DIR .. "3rdparty/luajit/pre/win_x64"
  41. }
  42. configuration {}
  43. end
  44. if _OPTIONS["with-openal"] then
  45. includedirs {
  46. CROWN_DIR .. "3rdparty/openal/include"
  47. }
  48. configuration {}
  49. links { "openal", }
  50. configuration {}
  51. end
  52. if _OPTIONS["with-bullet"] then
  53. includedirs {
  54. CROWN_DIR .. "3rdparty/bullet3/src",
  55. }
  56. links {
  57. "bullet",
  58. }
  59. configuration {}
  60. end
  61. configuration { "debug or development" }
  62. defines {
  63. "CROWN_DEBUG=1"
  64. }
  65. configuration { "development" }
  66. defines {
  67. "CROWN_DEVELOPMENT=1"
  68. }
  69. configuration { "android*" }
  70. kind "ConsoleApp"
  71. targetextension ".so"
  72. linkoptions {
  73. "-shared"
  74. }
  75. links {
  76. "gcc",
  77. "EGL",
  78. "GLESv2",
  79. }
  80. configuration { "linux-*" }
  81. links {
  82. "X11",
  83. "Xrandr",
  84. "pthread",
  85. "GL",
  86. }
  87. configuration { "vs* or mingw*" }
  88. links {
  89. "dbghelp",
  90. "xinput",
  91. "psapi",
  92. "ws2_32",
  93. "ole32",
  94. "gdi32",
  95. }
  96. configuration {}
  97. files {
  98. CROWN_DIR .. "src/**.h",
  99. CROWN_DIR .. "src/**.cpp"
  100. }
  101. strip()
  102. configuration {} -- reset configuration
  103. end