crown.lua 1.7 KB

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