crown.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. }
  34. if _OPTIONS["with-luajit"] then
  35. includedirs {
  36. CROWN_DIR .. "3rdparty/luajit/src",
  37. }
  38. configuration { "android-arm" }
  39. libdirs {
  40. CROWN_DIR .. "3rdparty/luajit/pre/android_arm"
  41. }
  42. configuration { "linux-* or android-arm" }
  43. links {
  44. "luajit"
  45. }
  46. configuration { "x32", "linux-*" }
  47. libdirs {
  48. CROWN_DIR .. "3rdparty/luajit/pre/linux_x86"
  49. }
  50. configuration { "x64", "linux-*" }
  51. libdirs {
  52. CROWN_DIR .. "3rdparty/luajit/pre/linux_x64"
  53. }
  54. configuration { "vs*"}
  55. links {
  56. "lua51"
  57. }
  58. configuration { "x32", "vs*" }
  59. libdirs {
  60. CROWN_DIR .. "3rdparty/luajit/pre/win_x86"
  61. }
  62. configuration { "x64", "vs*" }
  63. libdirs {
  64. CROWN_DIR .. "3rdparty/luajit/pre/win_x64"
  65. }
  66. configuration {}
  67. end
  68. if _OPTIONS["with-openal"] then
  69. includedirs {
  70. CROWN_DIR .. "3rdparty/openal/include"
  71. }
  72. configuration {}
  73. links { "openal", }
  74. configuration {}
  75. end
  76. if _OPTIONS["with-bullet"] then
  77. includedirs {
  78. CROWN_DIR .. "3rdparty/bullet3/src",
  79. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Collision",
  80. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Collision/BroadPhaseCollision",
  81. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Collision/NarrowPhaseCollision",
  82. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Common",
  83. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Dynamics",
  84. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Dynamics/ConstraintSover",
  85. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Geometry",
  86. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL",
  87. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL/BroadphaseCollision",
  88. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL/initialize",
  89. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL/NarrowPhaseCollision",
  90. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL/ParallelPrimitives",
  91. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL/Raycast",
  92. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3OpenCL/RigidBody",
  93. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Serialize",
  94. CROWN_DIR .. "3rdparty/bullet3/src/Bullet3Serialize/Bullet2FileLoader",
  95. CROWN_DIR .. "3rdparty/bullet3/src/BulletCollision",
  96. CROWN_DIR .. "3rdparty/bullet3/src/BulletCollision/BroadphaseCollision",
  97. CROWN_DIR .. "3rdparty/bullet3/src/BulletCollision/CollisionDispatch",
  98. CROWN_DIR .. "3rdparty/bullet3/src/BulletCollision/CollisionShapes",
  99. CROWN_DIR .. "3rdparty/bullet3/src/BulletCollision/Gimpact",
  100. CROWN_DIR .. "3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision",
  101. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics",
  102. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics/Character",
  103. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics/ConstraintSolver",
  104. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics/Dynamics",
  105. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics/Featherstone",
  106. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics/MLCPSolvers",
  107. CROWN_DIR .. "3rdparty/bullet3/src/BulletDynamics/Vehicle",
  108. CROWN_DIR .. "3rdparty/bullet3/src/BulletSoftBody",
  109. CROWN_DIR .. "3rdparty/bullet3/src/LinearMath",
  110. CROWN_DIR .. "3rdparty/bullet3/src/clew",
  111. }
  112. links {
  113. "bullet",
  114. }
  115. configuration {}
  116. end
  117. configuration { "debug or development" }
  118. defines {
  119. "CROWN_DEBUG=1"
  120. }
  121. configuration { "development" }
  122. defines {
  123. "CROWN_DEVELOPMENT=1"
  124. }
  125. configuration { "android*" }
  126. kind "ConsoleApp"
  127. targetextension ".so"
  128. linkoptions {
  129. "-shared"
  130. }
  131. links {
  132. "gcc",
  133. "EGL",
  134. "GLESv2",
  135. }
  136. configuration { "linux-*" }
  137. links {
  138. "X11",
  139. "Xrandr",
  140. "pthread",
  141. "dl",
  142. "GL",
  143. }
  144. configuration { "vs*" }
  145. links {
  146. "OpenGL32",
  147. "dbghelp",
  148. "xinput",
  149. "psapi",
  150. "ws2_32",
  151. }
  152. configuration {}
  153. files {
  154. CROWN_DIR .. "src/**.h",
  155. CROWN_DIR .. "src/**.cpp"
  156. }
  157. strip()
  158. configuration {} -- reset configuration
  159. end