crown.lua 11 KB

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