premake4.lua 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. --
  2. -- Copyright (c) 2012-2014 Daniele Bartolini and individual contributors.
  3. -- License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. --
  5. solution "crown"
  6. configurations {
  7. "debug",
  8. "development",
  9. "release",
  10. }
  11. platforms {
  12. "x32",
  13. "x64",
  14. "native"
  15. }
  16. language "C++"
  17. CROWN_DIR = (path.getabsolute("..") .. "/")
  18. local CROWN_THIRD_DIR = (CROWN_DIR .. "third/")
  19. local CROWN_BUILD_DIR = (CROWN_DIR .. ".build/")
  20. dofile (CROWN_DIR .. "premake/toolchain.lua")
  21. toolchain(CROWN_BUILD_DIR, CROWN_THIRD_DIR)
  22. configuration { "linux-*" }
  23. links {
  24. "X11",
  25. "Xrandr",
  26. "pthread",
  27. "GL",
  28. "openal",
  29. "luajit",
  30. "dl",
  31. }
  32. configuration { "debug", "linux-*" }
  33. links {
  34. "bgfxDebug"
  35. }
  36. linkoptions {
  37. "-rdynamic",
  38. "-Wl,--start-group $(addprefix -l," ..
  39. " LowLevelClothCHECKED" ..
  40. " PhysX3CHECKED " ..
  41. " PhysX3CommonCHECKED" ..
  42. " PxTaskCHECKED" ..
  43. " LowLevelCHECKED" ..
  44. " PhysX3CharacterKinematicCHECKED" ..
  45. " PhysX3CookingCHECKED" ..
  46. " PhysX3ExtensionsCHECKED" ..
  47. " PhysX3VehicleCHECKED" ..
  48. " PhysXProfileSDKCHECKED" ..
  49. " PhysXVisualDebuggerSDKCHECKED" ..
  50. " PvdRuntimeCHECKED" ..
  51. " SceneQueryCHECKED" ..
  52. " SimulationControllerCHECKED" ..
  53. ") -Wl,--end-group"
  54. }
  55. configuration { "development", "linux-*" }
  56. links {
  57. "bgfxDebug"
  58. }
  59. linkoptions
  60. {
  61. "-rdynamic",
  62. "-Wl,--start-group $(addprefix -l," ..
  63. " LowLevelClothPROFILE" ..
  64. " PhysX3PROFILE " ..
  65. " PhysX3CommonPROFILE" ..
  66. " PxTaskPROFILE" ..
  67. " LowLevelPROFILE" ..
  68. " PhysX3CharacterKinematicPROFILE" ..
  69. " PhysX3CookingPROFILE" ..
  70. " PhysX3ExtensionsPROFILE" ..
  71. " PhysX3VehiclePROFILE" ..
  72. " PhysXProfileSDKPROFILE" ..
  73. " PhysXVisualDebuggerSDKPROFILE" ..
  74. " PvdRuntimePROFILE" ..
  75. " SceneQueryPROFILE" ..
  76. " SimulationControllerPROFILE" ..
  77. ") -Wl,--end-group"
  78. }
  79. configuration { "release", "linux-*" }
  80. links {
  81. "bgfxRelease"
  82. }
  83. linkoptions {
  84. "-Wl,--start-group $(addprefix -l," ..
  85. " LowLevelCloth" ..
  86. " PhysX3 " ..
  87. " PhysX3Common" ..
  88. " PxTask" ..
  89. " LowLevel" ..
  90. " PhysX3CharacterKinematic" ..
  91. " PhysX3Cooking" ..
  92. " PhysX3Extensions" ..
  93. " PhysX3Vehicle" ..
  94. " PhysXProfileSDK" ..
  95. " PhysXVisualDebuggerSDK" ..
  96. " PvdRuntime" ..
  97. " SceneQuery" ..
  98. " SimulationController" ..
  99. ") -Wl,--end-group"
  100. }
  101. configuration { "android*" }
  102. kind "ConsoleApp"
  103. targetextension ".so"
  104. linkoptions {
  105. "-shared"
  106. }
  107. links {
  108. "EGL",
  109. "GLESv2",
  110. ":libluajit.a",
  111. "OpenSLES",
  112. }
  113. configuration { "debug", "android-arm" }
  114. links {
  115. ":libbgfxDebug.a",
  116. }
  117. linkoptions {
  118. "-Wl,--start-group $(addprefix -l," ..
  119. " LowLevelCloth" ..
  120. " PhysX3 " ..
  121. " PhysX3Common" ..
  122. " PxTask" ..
  123. " LowLevel" ..
  124. " PhysX3CharacterKinematic" ..
  125. " PhysX3Cooking" ..
  126. " PhysX3Extensions" ..
  127. " PhysX3Vehicle" ..
  128. " PhysXProfileSDK" ..
  129. " PhysXVisualDebuggerSDK" ..
  130. " PvdRuntime" ..
  131. " SceneQuery" ..
  132. " SimulationController" ..
  133. ") -Wl,--end-group"
  134. }
  135. configuration { "development", "android-arm" }
  136. links {
  137. ":libbgfxDebug.a",
  138. }
  139. linkoptions {
  140. "-Wl,--start-group $(addprefix -l," ..
  141. " LowLevelCloth" ..
  142. " PhysX3 " ..
  143. " PhysX3Common" ..
  144. " PxTask" ..
  145. " LowLevel" ..
  146. " PhysX3CharacterKinematic" ..
  147. " PhysX3Cooking" ..
  148. " PhysX3Extensions" ..
  149. " PhysX3Vehicle" ..
  150. " PhysXProfileSDK" ..
  151. " PhysXVisualDebuggerSDK" ..
  152. " PvdRuntime" ..
  153. " SceneQuery" ..
  154. " SimulationController" ..
  155. ") -Wl,--end-group"
  156. }
  157. configuration { "release", "android-arm" }
  158. links {
  159. ":libbgfxRelease.a",
  160. }
  161. linkoptions {
  162. "-Wl,--start-group $(addprefix -l," ..
  163. " LowLevelCloth" ..
  164. " PhysX3 " ..
  165. " PhysX3Common" ..
  166. " PxTask" ..
  167. " LowLevel" ..
  168. " PhysX3CharacterKinematic" ..
  169. " PhysX3Cooking" ..
  170. " PhysX3Extensions" ..
  171. " PhysX3Vehicle" ..
  172. " PhysXProfileSDK" ..
  173. " PhysXVisualDebuggerSDK" ..
  174. " PvdRuntime" ..
  175. " SceneQuery" ..
  176. " SimulationController" ..
  177. ") -Wl,--end-group"
  178. }
  179. configuration { "vs*" }
  180. links {
  181. "OpenGL32",
  182. "lua51",
  183. "OpenAL32",
  184. "dbghelp"
  185. }
  186. configuration { "debug", "x32", "vs*"}
  187. links {
  188. "PhysX3CharacterKinematicCHECKED_x86",
  189. "PhysX3CHECKED_x86",
  190. "PhysX3CommonCHECKED_x86",
  191. "PhysX3CookingCHECKED_x86",
  192. "PhysX3ExtensionsCHECKED",
  193. "bgfxDebug"
  194. }
  195. configuration { "debug", "x64", "vs*" }
  196. links {
  197. "PhysX3CharacterKinematicCHECKED_x64",
  198. "PhysX3CHECKED_x64",
  199. "PhysX3CommonCHECKED_x64",
  200. "PhysX3CookingCHECKED_x64",
  201. "PhysX3ExtensionsCHECKED",
  202. "bgfxDebug"
  203. }
  204. configuration { "development", "x32", "vs*" }
  205. links {
  206. "PhysX3CharacterKinematicPROFILE_x86",
  207. "PhysX3PROFILE_x86",
  208. "PhysX3CommonPROFILE_x86",
  209. "PhysX3CookingPROFILE_x86",
  210. "PhysX3ExtensionsPROFILE",
  211. "bgfxDebug"
  212. }
  213. configuration { "development", "x64", "vs*" }
  214. links {
  215. "PhysX3CharacterKinematicPROFILE_x64",
  216. "PhysX3PROFILE_x64",
  217. "PhysX3CommonPROFILE_x64",
  218. "PhysX3CookingPROFILE_x64",
  219. "PhysX3ExtensionsPROFILE",
  220. "bgfxDebug"
  221. }
  222. configuration { "release", "x32", "vs*" }
  223. links {
  224. "PhysX3CharacterKinematic_x86",
  225. "PhysX3_x86",
  226. "PhysX3Common_x86",
  227. "PhysX3Cooking_x86",
  228. "PhysX3Extensions",
  229. "bgfxRelease"
  230. }
  231. configuration { "release", "x64", "vs*" }
  232. links {
  233. "PhysX3CharacterKinematic_x64",
  234. "PhysX3_x64",
  235. "PhysX3Common_x64",
  236. "PhysX3Cooking_x64",
  237. "PhysX3Extensions",
  238. "bgfxRelease"
  239. }
  240. dofile "crown.lua"
  241. crown_project("", "WindowedApp", {})
  242. -- Install
  243. configuration { "android-arm" }
  244. postbuildcommands {
  245. "cp -r " .. CROWN_DIR .. ".build/android-arm/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/android-arm/",
  246. }
  247. configuration { "x32", "linux-*" }
  248. postbuildcommands {
  249. "cp -r " .. CROWN_DIR .. ".build/linux32/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux32/",
  250. "cp " .. CROWN_THIRD_DIR .. "luajit/src/luajit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux32/",
  251. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux32/",
  252. }
  253. configuration { "x64", "linux-*" }
  254. postbuildcommands {
  255. "cp -r " .. CROWN_DIR .. ".build/linux64/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux64/",
  256. "cp " .. CROWN_THIRD_DIR .. "luajit/src/luajit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux64/",
  257. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux64/",
  258. }
  259. configuration { "x32", "vs*" }
  260. postbuildcommands {
  261. "cp -r " .. CROWN_DIR .. ".build/win32/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32/",
  262. "cp " .. CROWN_THIRD_DIR .. "luajit/src/luajit.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32/",
  263. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32/",
  264. }
  265. configuration { "x64", "vs*" }
  266. postbuildcommands {
  267. "cp -r " .. CROWN_DIR .. ".build/win64/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64/",
  268. "cp " .. CROWN_THIRD_DIR .. "luajit/src/luajit.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64/",
  269. "cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64/",
  270. }
  271. configuration { "debug or development", "x32", "linux-*" }
  272. postbuildcommands {
  273. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux32_gcc/bin/shadercDebug " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux32"
  274. }
  275. configuration { "release", "x32", "linux-*" }
  276. postbuildcommands {
  277. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux32_gcc/bin/shadercRelease " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux32"
  278. }
  279. configuration { "debug or development", "x64", "linux-*" }
  280. postbuildcommands {
  281. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux64_gcc/bin/shadercDebug " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux64"
  282. }
  283. configuration { "release", "x64", "linux-*" }
  284. postbuildcommands {
  285. "cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux64_gcc/bin/shadercRelease " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux64"
  286. }