crown.lua 2.4 KB

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