crown.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. --
  2. -- Copyright (c) 2012-2015 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/filesystem",
  13. CROWN_DIR .. "src/core/json",
  14. CROWN_DIR .. "src/core/math",
  15. CROWN_DIR .. "src/core/memory",
  16. CROWN_DIR .. "src/core/network",
  17. CROWN_DIR .. "src/core/settings",
  18. CROWN_DIR .. "src/core/strings",
  19. CROWN_DIR .. "src/core/thread",
  20. CROWN_DIR .. "src/main",
  21. CROWN_DIR .. "src/input",
  22. CROWN_DIR .. "src/renderers",
  23. CROWN_DIR .. "src/resource",
  24. CROWN_DIR .. "src/lua",
  25. CROWN_DIR .. "src/audio",
  26. CROWN_DIR .. "src/compilers",
  27. CROWN_DIR .. "src/physics",
  28. CROWN_DIR .. "src/world",
  29. CROWN_DIR .. "third/freetype",
  30. CROWN_DIR .. "third/stb_image",
  31. CROWN_DIR .. "third/stb_vorbis",
  32. CROWN_DIR .. "third/bgfx/src",
  33. CROWN_DIR .. "third/bgfx/include",
  34. CROWN_DIR .. "third/bx/include",
  35. }
  36. defines {
  37. _defines,
  38. }
  39. links {
  40. "bgfx"
  41. }
  42. if _OPTIONS["with-luajit"] then
  43. includedirs {
  44. CROWN_DIR .. "third/luajit/src",
  45. }
  46. configuration { "android-arm" }
  47. libdirs {
  48. CROWN_DIR .. "third/luajit/pre/android_arm"
  49. }
  50. configuration { "linux-* or android-arm" }
  51. links {
  52. "luajit"
  53. }
  54. configuration { "x32", "linux-*" }
  55. libdirs {
  56. CROWN_DIR .. "third/luajit/pre/linux_x86"
  57. }
  58. configuration { "x64", "linux-*" }
  59. libdirs {
  60. CROWN_DIR .. "third/luajit/pre/linux_x64"
  61. }
  62. configuration { "vs*"}
  63. links {
  64. "lua51"
  65. }
  66. configuration { "x32", "vs*" }
  67. libdirs {
  68. CROWN_DIR .. "third/luajit/pre/win_x86"
  69. }
  70. configuration { "x64", "vs*" }
  71. libdirs {
  72. CROWN_DIR .. "third/luajit/pre/win_x64"
  73. }
  74. configuration {}
  75. end
  76. if _OPTIONS["with-openal"] then
  77. includedirs {
  78. CROWN_DIR .. "third/openal/include"
  79. }
  80. -- Fix this in GENie
  81. configuration { "debug", "x32", "linux-*" }
  82. linkoptions { "-Lbin/debug", "-lopenal-debug-32", }
  83. configuration { "development", "x32", "linux-*" }
  84. linkoptions { "-Lbin/debug", "-lopenal-development-32", }
  85. configuration { "release", "x32", "linux-*" }
  86. linkoptions { "-Lbin/debug", "-lopenal-release-32", }
  87. configuration { "debug", "x64", "linux-*" }
  88. linkoptions { "-Lbin/debug", "-lopenal-debug-64", }
  89. configuration { "development", "x64", "linux-*" }
  90. linkoptions { "-Lbin/debug", "-lopenal-development-64", }
  91. configuration { "release", "x64", "linux-*" }
  92. linkoptions { "-Lbin/debug", "-lopenal-release-64", }
  93. configuration { "vs*" }
  94. links { "openal", }
  95. configuration {}
  96. end
  97. configuration { "debug or development" }
  98. flags {
  99. "Symbols"
  100. }
  101. defines {
  102. "_DEBUG",
  103. "CROWN_DEBUG=1"
  104. }
  105. configuration { "release" }
  106. defines {
  107. "NDEBUG"
  108. }
  109. configuration { "linux*" }
  110. includedirs {
  111. "$(PHYSX_SDK_LINUX)/Include",
  112. "$(PHYSX_SDK_LINUX)/Include/common",
  113. "$(PHYSX_SDK_LINUX)/Include/characterkinematic",
  114. "$(PHYSX_SDK_LINUX)/Include/cloth",
  115. "$(PHYSX_SDK_LINUX)/Include/common",
  116. "$(PHYSX_SDK_LINUX)/Include/cooking",
  117. "$(PHYSX_SDK_LINUX)/Include/extensions",
  118. "$(PHYSX_SDK_LINUX)/Include/foundation",
  119. "$(PHYSX_SDK_LINUX)/Include/geometry",
  120. "$(PHYSX_SDK_LINUX)/Include/particles",
  121. "$(PHYSX_SDK_LINUX)/Include/physxprofilesdk",
  122. "$(PHYSX_SDK_LINUX)/Include/physxvisualdebuggersdk",
  123. "$(PHYSX_SDK_LINUX)/Include/pvd",
  124. "$(PHYSX_SDK_LINUX)/Include/pxtask",
  125. "$(PHYSX_SDK_LINUX)/Include/RepX",
  126. "$(PHYSX_SDK_LINUX)/Include/RepXUpgrader",
  127. "$(PHYSX_SDK_LINUX)/Include/vehicle",
  128. }
  129. configuration { "android*" }
  130. includedirs {
  131. "$(PHYSX_SDK_ANDROID)/Include",
  132. "$(PHYSX_SDK_ANDROID)/Include/common",
  133. "$(PHYSX_SDK_ANDROID)/Include/characterkinematic",
  134. "$(PHYSX_SDK_ANDROID)/Include/cloth",
  135. "$(PHYSX_SDK_ANDROID)/Include/common",
  136. "$(PHYSX_SDK_ANDROID)/Include/cooking",
  137. "$(PHYSX_SDK_ANDROID)/Include/extensions",
  138. "$(PHYSX_SDK_ANDROID)/Include/foundation",
  139. "$(PHYSX_SDK_ANDROID)/Include/geometry",
  140. "$(PHYSX_SDK_ANDROID)/Include/particles",
  141. "$(PHYSX_SDK_ANDROID)/Include/physxprofilesdk",
  142. "$(PHYSX_SDK_ANDROID)/Include/physxvisualdebuggersdk",
  143. "$(PHYSX_SDK_ANDROID)/Include/pvd",
  144. "$(PHYSX_SDK_ANDROID)/Include/pxtask",
  145. "$(PHYSX_SDK_ANDROID)/Include/RepX",
  146. "$(PHYSX_SDK_ANDROID)/Include/RepXUpgrader",
  147. "$(PHYSX_SDK_ANDROID)/Include/vehicle",
  148. }
  149. configuration { "vs*" }
  150. includedirs {
  151. "$(PHYSX_SDK_WINDOWS)/Include",
  152. "$(PHYSX_SDK_WINDOWS)/Include/common",
  153. "$(PHYSX_SDK_WINDOWS)/Include/characterkinematic",
  154. "$(PHYSX_SDK_WINDOWS)/Include/cloth",
  155. "$(PHYSX_SDK_WINDOWS)/Include/common",
  156. "$(PHYSX_SDK_WINDOWS)/Include/cooking",
  157. "$(PHYSX_SDK_WINDOWS)/Include/extensions",
  158. "$(PHYSX_SDK_WINDOWS)/Include/foundation",
  159. "$(PHYSX_SDK_WINDOWS)/Include/geometry",
  160. "$(PHYSX_SDK_WINDOWS)/Include/particles",
  161. "$(PHYSX_SDK_WINDOWS)/Include/physxprofilesdk",
  162. "$(PHYSX_SDK_WINDOWS)/Include/physxvisualdebuggersdk",
  163. "$(PHYSX_SDK_WINDOWS)/Include/pvd",
  164. "$(PHYSX_SDK_WINDOWS)/Include/pxtask",
  165. "$(PHYSX_SDK_WINDOWS)/Include/RepX",
  166. "$(PHYSX_SDK_WINDOWS)/Include/RepXUpgrader",
  167. "$(PHYSX_SDK_WINDOWS)/Include/vehicle",
  168. "$(DXSDK_DIR)/Include",
  169. }
  170. configuration { "linux-*" }
  171. links {
  172. "X11",
  173. "Xrandr",
  174. "pthread",
  175. "GL",
  176. "dl",
  177. }
  178. configuration { "debug", "linux-*" }
  179. linkoptions {
  180. "-rdynamic",
  181. "-Wl,--start-group $(addprefix -l," ..
  182. " LowLevelClothCHECKED" ..
  183. " PhysX3CHECKED " ..
  184. " PhysX3CommonCHECKED" ..
  185. " PxTaskCHECKED" ..
  186. " LowLevelCHECKED" ..
  187. " PhysX3CharacterKinematicCHECKED" ..
  188. " PhysX3CookingCHECKED" ..
  189. " PhysX3ExtensionsCHECKED" ..
  190. " PhysX3VehicleCHECKED" ..
  191. " PhysXProfileSDKCHECKED" ..
  192. " PhysXVisualDebuggerSDKCHECKED" ..
  193. " PvdRuntimeCHECKED" ..
  194. " SceneQueryCHECKED" ..
  195. " SimulationControllerCHECKED" ..
  196. ") -Wl,--end-group"
  197. }
  198. configuration { "development", "linux-*" }
  199. linkoptions
  200. {
  201. "-rdynamic",
  202. "-Wl,--start-group $(addprefix -l," ..
  203. " LowLevelClothPROFILE" ..
  204. " PhysX3PROFILE " ..
  205. " PhysX3CommonPROFILE" ..
  206. " PxTaskPROFILE" ..
  207. " LowLevelPROFILE" ..
  208. " PhysX3CharacterKinematicPROFILE" ..
  209. " PhysX3CookingPROFILE" ..
  210. " PhysX3ExtensionsPROFILE" ..
  211. " PhysX3VehiclePROFILE" ..
  212. " PhysXProfileSDKPROFILE" ..
  213. " PhysXVisualDebuggerSDKPROFILE" ..
  214. " PvdRuntimePROFILE" ..
  215. " SceneQueryPROFILE" ..
  216. " SimulationControllerPROFILE" ..
  217. ") -Wl,--end-group"
  218. }
  219. configuration { "release", "linux-*" }
  220. linkoptions {
  221. "-Wl,--start-group $(addprefix -l," ..
  222. " LowLevelCloth" ..
  223. " PhysX3 " ..
  224. " PhysX3Common" ..
  225. " PxTask" ..
  226. " LowLevel" ..
  227. " PhysX3CharacterKinematic" ..
  228. " PhysX3Cooking" ..
  229. " PhysX3Extensions" ..
  230. " PhysX3Vehicle" ..
  231. " PhysXProfileSDK" ..
  232. " PhysXVisualDebuggerSDK" ..
  233. " PvdRuntime" ..
  234. " SceneQuery" ..
  235. " SimulationController" ..
  236. ") -Wl,--end-group"
  237. }
  238. configuration { "android*" }
  239. kind "ConsoleApp"
  240. targetextension ".so"
  241. linkoptions {
  242. "-shared"
  243. }
  244. links {
  245. "EGL",
  246. "GLESv2",
  247. "OpenSLES",
  248. }
  249. configuration { "debug", "android-arm" }
  250. linkoptions {
  251. "-Wl,--start-group $(addprefix -l," ..
  252. " LowLevelCloth" ..
  253. " PhysX3 " ..
  254. " PhysX3Common" ..
  255. " PxTask" ..
  256. " LowLevel" ..
  257. " PhysX3CharacterKinematic" ..
  258. " PhysX3Cooking" ..
  259. " PhysX3Extensions" ..
  260. " PhysX3Vehicle" ..
  261. " PhysXProfileSDK" ..
  262. " PhysXVisualDebuggerSDK" ..
  263. " PvdRuntime" ..
  264. " SceneQuery" ..
  265. " SimulationController" ..
  266. ") -Wl,--end-group"
  267. }
  268. configuration { "development", "android-arm" }
  269. linkoptions {
  270. "-Wl,--start-group $(addprefix -l," ..
  271. " LowLevelCloth" ..
  272. " PhysX3 " ..
  273. " PhysX3Common" ..
  274. " PxTask" ..
  275. " LowLevel" ..
  276. " PhysX3CharacterKinematic" ..
  277. " PhysX3Cooking" ..
  278. " PhysX3Extensions" ..
  279. " PhysX3Vehicle" ..
  280. " PhysXProfileSDK" ..
  281. " PhysXVisualDebuggerSDK" ..
  282. " PvdRuntime" ..
  283. " SceneQuery" ..
  284. " SimulationController" ..
  285. ") -Wl,--end-group"
  286. }
  287. configuration { "release", "android-arm" }
  288. linkoptions {
  289. "-Wl,--start-group $(addprefix -l," ..
  290. " LowLevelCloth" ..
  291. " PhysX3 " ..
  292. " PhysX3Common" ..
  293. " PxTask" ..
  294. " LowLevel" ..
  295. " PhysX3CharacterKinematic" ..
  296. " PhysX3Cooking" ..
  297. " PhysX3Extensions" ..
  298. " PhysX3Vehicle" ..
  299. " PhysXProfileSDK" ..
  300. " PhysXVisualDebuggerSDK" ..
  301. " PvdRuntime" ..
  302. " SceneQuery" ..
  303. " SimulationController" ..
  304. ") -Wl,--end-group"
  305. }
  306. configuration { "vs*" }
  307. links {
  308. "OpenGL32",
  309. "dbghelp",
  310. }
  311. configuration { "debug", "x32", "vs*"}
  312. links {
  313. "PhysX3CharacterKinematicCHECKED_x86",
  314. "PhysX3CHECKED_x86",
  315. "PhysX3CommonCHECKED_x86",
  316. "PhysX3CookingCHECKED_x86",
  317. "PhysX3ExtensionsCHECKED",
  318. }
  319. configuration { "debug", "x64", "vs*" }
  320. links {
  321. "PhysX3CharacterKinematicCHECKED_x64",
  322. "PhysX3CHECKED_x64",
  323. "PhysX3CommonCHECKED_x64",
  324. "PhysX3CookingCHECKED_x64",
  325. "PhysX3ExtensionsCHECKED",
  326. }
  327. configuration { "development", "x32", "vs*" }
  328. links {
  329. "PhysX3CharacterKinematicPROFILE_x86",
  330. "PhysX3PROFILE_x86",
  331. "PhysX3CommonPROFILE_x86",
  332. "PhysX3CookingPROFILE_x86",
  333. "PhysX3ExtensionsPROFILE",
  334. }
  335. configuration { "development", "x64", "vs*" }
  336. links {
  337. "PhysX3CharacterKinematicPROFILE_x64",
  338. "PhysX3PROFILE_x64",
  339. "PhysX3CommonPROFILE_x64",
  340. "PhysX3CookingPROFILE_x64",
  341. "PhysX3ExtensionsPROFILE",
  342. }
  343. configuration { "release", "x32", "vs*" }
  344. links {
  345. "PhysX3CharacterKinematic_x86",
  346. "PhysX3_x86",
  347. "PhysX3Common_x86",
  348. "PhysX3Cooking_x86",
  349. "PhysX3Extensions",
  350. }
  351. configuration { "release", "x64", "vs*" }
  352. links {
  353. "PhysX3CharacterKinematic_x64",
  354. "PhysX3_x64",
  355. "PhysX3Common_x64",
  356. "PhysX3Cooking_x64",
  357. "PhysX3Extensions",
  358. }
  359. configuration {}
  360. files {
  361. CROWN_DIR .. "src/**.h",
  362. CROWN_DIR .. "src/**.cpp"
  363. }
  364. strip()
  365. configuration {} -- reset configuration
  366. end