toolchain.lua 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228
  1. --
  2. -- Copyright 2010-2016 Branimir Karadzic. All rights reserved.
  3. -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
  4. --
  5. local bxDir = path.getabsolute("..")
  6. local naclToolchain = ""
  7. function toolchain(_buildDir, _libDir)
  8. newoption {
  9. trigger = "gcc",
  10. value = "GCC",
  11. description = "Choose GCC flavor",
  12. allowed = {
  13. { "android-arm", "Android - ARM" },
  14. { "android-mips", "Android - MIPS" },
  15. { "android-x86", "Android - x86" },
  16. { "asmjs", "Emscripten/asm.js" },
  17. { "freebsd", "FreeBSD" },
  18. { "ios-arm", "iOS - ARM" },
  19. { "ios-simulator", "iOS - Simulator" },
  20. { "linux-gcc", "Linux (GCC compiler)" },
  21. { "linux-gcc-5", "Linux (GCC-5 compiler)" },
  22. { "linux-clang", "Linux (Clang compiler)" },
  23. { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
  24. { "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
  25. { "linux-steamlink", "Steam Link" },
  26. { "tvos-arm64", "tvOS - ARM64" },
  27. { "tvos-simulator", "tvOS - Simulator" },
  28. { "mingw-gcc", "MinGW" },
  29. { "mingw-clang", "MinGW (clang compiler)" },
  30. { "nacl", "Native Client" },
  31. { "nacl-arm", "Native Client - ARM" },
  32. { "osx", "OSX" },
  33. { "pnacl", "Native Client - PNaCl" },
  34. { "ps4", "PS4" },
  35. { "qnx-arm", "QNX/Blackberry - ARM" },
  36. { "rpi", "RaspberryPi" },
  37. { "riscv", "RISC-V" },
  38. },
  39. }
  40. newoption {
  41. trigger = "vs",
  42. value = "toolset",
  43. description = "Choose VS toolset",
  44. allowed = {
  45. { "vs2012-clang", "Clang 3.6" },
  46. { "vs2013-clang", "Clang 3.6" },
  47. { "vs2015-clang", "Clang 3.9" },
  48. { "vs2012-xp", "Visual Studio 2012 targeting XP" },
  49. { "vs2013-xp", "Visual Studio 2013 targeting XP" },
  50. { "vs2015-xp", "Visual Studio 2015 targeting XP" },
  51. { "winphone8", "Windows Phone 8.0" },
  52. { "winphone81", "Windows Phone 8.1" },
  53. { "winstore81", "Windows Store 8.1" },
  54. { "winstore82", "Universal Windows App" },
  55. { "durango", "Durango" },
  56. },
  57. }
  58. newoption {
  59. trigger = "xcode",
  60. value = "xcode_target",
  61. description = "Choose XCode target",
  62. allowed = {
  63. { "osx", "OSX" },
  64. { "ios", "iOS" },
  65. { "tvos", "tvOS" },
  66. }
  67. }
  68. newoption {
  69. trigger = "with-android",
  70. value = "#",
  71. description = "Set Android platform version (default: android-14).",
  72. }
  73. newoption {
  74. trigger = "with-ios",
  75. value = "#",
  76. description = "Set iOS target version (default: 8.0).",
  77. }
  78. newoption {
  79. trigger = "with-tvos",
  80. value = "#",
  81. description = "Set tvOS target version (default: 9.0).",
  82. }
  83. newoption {
  84. trigger = "with-dynamic-runtime",
  85. description = "Dynamically link with the runtime rather than statically",
  86. }
  87. -- Avoid error when invoking genie --help.
  88. if (_ACTION == nil) then return false end
  89. location (path.join(_buildDir, "projects", _ACTION))
  90. if _ACTION == "clean" then
  91. os.rmdir(BUILD_DIR)
  92. end
  93. local androidPlatform = "android-14"
  94. if _OPTIONS["with-android"] then
  95. androidPlatform = "android-" .. _OPTIONS["with-android"]
  96. end
  97. local iosPlatform = ""
  98. if _OPTIONS["with-ios"] then
  99. iosPlatform = _OPTIONS["with-ios"]
  100. end
  101. local tvosPlatform = ""
  102. if _OPTIONS["with-tvos"] then
  103. tvosPlatform = _OPTIONS["with-tvos"]
  104. end
  105. if _ACTION == "gmake" then
  106. if nil == _OPTIONS["gcc"] then
  107. print("GCC flavor must be specified!")
  108. os.exit(1)
  109. end
  110. flags {
  111. "ExtraWarnings",
  112. }
  113. if "android-arm" == _OPTIONS["gcc"] then
  114. if not os.getenv("ANDROID_NDK_ARM") or not os.getenv("ANDROID_NDK_ROOT") then
  115. print("Set ANDROID_NDK_ARM and ANDROID_NDK_ROOT envrionment variables.")
  116. end
  117. premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
  118. premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
  119. premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
  120. location (path.join(_buildDir, "projects", _ACTION .. "-android-arm"))
  121. elseif "android-mips" == _OPTIONS["gcc"] then
  122. if not os.getenv("ANDROID_NDK_MIPS") or not os.getenv("ANDROID_NDK_ROOT") then
  123. print("Set ANDROID_NDK_MIPS and ANDROID_NDK_ROOT envrionment variables.")
  124. end
  125. premake.gcc.cc = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-gcc"
  126. premake.gcc.cxx = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-g++"
  127. premake.gcc.ar = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar"
  128. location (path.join(_buildDir, "projects", _ACTION .. "-android-mips"))
  129. elseif "android-x86" == _OPTIONS["gcc"] then
  130. if not os.getenv("ANDROID_NDK_X86") or not os.getenv("ANDROID_NDK_ROOT") then
  131. print("Set ANDROID_NDK_X86 and ANDROID_NDK_ROOT envrionment variables.")
  132. end
  133. premake.gcc.cc = "$(ANDROID_NDK_X86)/bin/i686-linux-android-gcc"
  134. premake.gcc.cxx = "$(ANDROID_NDK_X86)/bin/i686-linux-android-g++"
  135. premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar"
  136. location (path.join(_buildDir, "projects", _ACTION .. "-android-x86"))
  137. elseif "asmjs" == _OPTIONS["gcc"] then
  138. if not os.getenv("EMSCRIPTEN") then
  139. print("Set EMSCRIPTEN enviroment variable.")
  140. end
  141. premake.gcc.cc = "$(EMSCRIPTEN)/emcc"
  142. premake.gcc.cxx = "$(EMSCRIPTEN)/em++"
  143. premake.gcc.ar = "$(EMSCRIPTEN)/emar"
  144. premake.gcc.llvm = true
  145. location (path.join(_buildDir, "projects", _ACTION .. "-asmjs"))
  146. elseif "freebsd" == _OPTIONS["gcc"] then
  147. location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
  148. elseif "ios-arm" == _OPTIONS["gcc"] then
  149. premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  150. premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
  151. premake.gcc.ar = "ar"
  152. location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm"))
  153. elseif "ios-simulator" == _OPTIONS["gcc"] then
  154. premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  155. premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
  156. premake.gcc.ar = "ar"
  157. location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator"))
  158. elseif "tvos-arm64" == _OPTIONS["gcc"] then
  159. premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  160. premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
  161. premake.gcc.ar = "ar"
  162. location (path.join(_buildDir, "projects", _ACTION .. "-tvos-arm64"))
  163. elseif "tvos-simulator" == _OPTIONS["gcc"] then
  164. premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  165. premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
  166. premake.gcc.ar = "ar"
  167. location (path.join(_buildDir, "projects", _ACTION .. "-tvos-simulator"))
  168. elseif "linux-gcc" == _OPTIONS["gcc"] then
  169. location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
  170. elseif "linux-gcc-5" == _OPTIONS["gcc"] then
  171. premake.gcc.cc = "gcc-5"
  172. premake.gcc.cxx = "g++-5"
  173. premake.gcc.ar = "ar"
  174. location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
  175. elseif "linux-clang" == _OPTIONS["gcc"] then
  176. premake.gcc.cc = "clang"
  177. premake.gcc.cxx = "clang++"
  178. premake.gcc.ar = "ar"
  179. location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
  180. elseif "linux-mips-gcc" == _OPTIONS["gcc"] then
  181. location (path.join(_buildDir, "projects", _ACTION .. "-linux-mips-gcc"))
  182. elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
  183. location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
  184. elseif "linux-steamlink" == _OPTIONS["gcc"] then
  185. if not os.getenv("MARVELL_SDK_PATH") then
  186. print("Set MARVELL_SDK_PATH enviroment variable.")
  187. end
  188. premake.gcc.cc = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-gcc"
  189. premake.gcc.cxx = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-g++"
  190. premake.gcc.ar = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-ar"
  191. location (path.join(_buildDir, "projects", _ACTION .. "-linux-steamlink"))
  192. elseif "mingw-gcc" == _OPTIONS["gcc"] then
  193. premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
  194. premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
  195. premake.gcc.ar = "$(MINGW)/bin/ar"
  196. location (path.join(_buildDir, "projects", _ACTION .. "-mingw-gcc"))
  197. elseif "mingw-clang" == _OPTIONS["gcc"] then
  198. premake.gcc.cc = "$(CLANG)/bin/clang"
  199. premake.gcc.cxx = "$(CLANG)/bin/clang++"
  200. premake.gcc.ar = "$(MINGW)/bin/ar"
  201. -- premake.gcc.ar = "$(CLANG)/bin/llvm-ar"
  202. -- premake.gcc.llvm = true
  203. location (path.join(_buildDir, "projects", _ACTION .. "-mingw-clang"))
  204. elseif "nacl" == _OPTIONS["gcc"] then
  205. if not os.getenv("NACL_SDK_ROOT") then
  206. print("Set NACL_SDK_ROOT enviroment variable.")
  207. end
  208. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-"
  209. if os.is("macosx") then
  210. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_x86_newlib/bin/x86_64-nacl-"
  211. elseif os.is("linux") then
  212. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/bin/x86_64-nacl-"
  213. end
  214. premake.gcc.cc = naclToolchain .. "gcc"
  215. premake.gcc.cxx = naclToolchain .. "g++"
  216. premake.gcc.ar = naclToolchain .. "ar"
  217. location (path.join(_buildDir, "projects", _ACTION .. "-nacl"))
  218. elseif "nacl-arm" == _OPTIONS["gcc"] then
  219. if not os.getenv("NACL_SDK_ROOT") then
  220. print("Set NACL_SDK_ROOT enviroment variable.")
  221. end
  222. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-"
  223. if os.is("macosx") then
  224. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_arm_newlib/bin/arm-nacl-"
  225. elseif os.is("linux") then
  226. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_arm_newlib/bin/arm-nacl-"
  227. end
  228. premake.gcc.cc = naclToolchain .. "gcc"
  229. premake.gcc.cxx = naclToolchain .. "g++"
  230. premake.gcc.ar = naclToolchain .. "ar"
  231. location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm"))
  232. elseif "osx" == _OPTIONS["gcc"] then
  233. if os.is("linux") then
  234. local osxToolchain = "x86_64-apple-darwin13-"
  235. premake.gcc.cc = osxToolchain .. "clang"
  236. premake.gcc.cxx = osxToolchain .. "clang++"
  237. premake.gcc.ar = osxToolchain .. "ar"
  238. end
  239. location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
  240. elseif "pnacl" == _OPTIONS["gcc"] then
  241. if not os.getenv("NACL_SDK_ROOT") then
  242. print("Set NACL_SDK_ROOT enviroment variable.")
  243. end
  244. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_pnacl/bin/pnacl-"
  245. if os.is("macosx") then
  246. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_pnacl/bin/pnacl-"
  247. elseif os.is("linux") then
  248. naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_pnacl/bin/pnacl-"
  249. end
  250. premake.gcc.cc = naclToolchain .. "clang"
  251. premake.gcc.cxx = naclToolchain .. "clang++"
  252. premake.gcc.ar = naclToolchain .. "ar"
  253. location (path.join(_buildDir, "projects", _ACTION .. "-pnacl"))
  254. elseif "ps4" == _OPTIONS["gcc"] then
  255. if not os.getenv("PS4_SDK_ROOT") then
  256. print("Set PS4_SDK_ROOT enviroment variable.")
  257. end
  258. ps4Toolchain = "$(PS4_SDK_ROOT)/host_tools/bin/orbis-"
  259. premake.gcc.cc = ps4Toolchain .. "clang"
  260. premake.gcc.cxx = ps4Toolchain .. "clang++"
  261. premake.gcc.ar = ps4Toolchain .. "ar"
  262. location (path.join(_buildDir, "projects", _ACTION .. "-ps4"))
  263. elseif "qnx-arm" == _OPTIONS["gcc"] then
  264. if not os.getenv("QNX_HOST") then
  265. print("Set QNX_HOST enviroment variable.")
  266. end
  267. premake.gcc.cc = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc"
  268. premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++"
  269. premake.gcc.ar = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar"
  270. location (path.join(_buildDir, "projects", _ACTION .. "-qnx-arm"))
  271. elseif "rpi" == _OPTIONS["gcc"] then
  272. location (path.join(_buildDir, "projects", _ACTION .. "-rpi"))
  273. elseif "riscv" == _OPTIONS["gcc"] then
  274. premake.gcc.cc = "$(RISCV_DIR)/bin/riscv64-unknown-elf-gcc"
  275. premake.gcc.cxx = "$(RISCV_DIR)/bin/riscv64-unknown-elf-g++"
  276. premake.gcc.ar = "$(RISCV_DIR)/bin/riscv64-unknown-elf-ar"
  277. location (path.join(_buildDir, "projects", _ACTION .. "-riscv"))
  278. end
  279. elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then
  280. if (_ACTION .. "-clang") == _OPTIONS["vs"] then
  281. if "vs2015-clang" == _OPTIONS["vs"] then
  282. premake.vstudio.toolset = ("LLVM-vs2014")
  283. else
  284. premake.vstudio.toolset = ("LLVM-" .. _ACTION)
  285. end
  286. location (path.join(_buildDir, "projects", _ACTION .. "-clang"))
  287. elseif "winphone8" == _OPTIONS["vs"] then
  288. premake.vstudio.toolset = "v110_wp80"
  289. location (path.join(_buildDir, "projects", _ACTION .. "-winphone8"))
  290. elseif "winphone81" == _OPTIONS["vs"] then
  291. premake.vstudio.toolset = "v120_wp81"
  292. premake.vstudio.storeapp = "8.1"
  293. platforms { "ARM" }
  294. location (path.join(_buildDir, "projects", _ACTION .. "-winphone81"))
  295. elseif "winstore81" == _OPTIONS["vs"] then
  296. premake.vstudio.toolset = "v120"
  297. premake.vstudio.storeapp = "8.1"
  298. platforms { "ARM" }
  299. location (path.join(_buildDir, "projects", _ACTION .. "-winstore81"))
  300. elseif "winstore82" == _OPTIONS["vs"] then
  301. premake.vstudio.toolset = "v140"
  302. premake.vstudio.storeapp = "8.2"
  303. platforms { "ARM" }
  304. location (path.join(_buildDir, "projects", _ACTION .. "-winstore82"))
  305. elseif "durango" == _OPTIONS["vs"] then
  306. if not os.getenv("DurangoXDK") then
  307. print("DurangoXDK not found.")
  308. end
  309. premake.vstudio.toolset = "v140"
  310. premake.vstudio.storeapp = "durango"
  311. platforms { "Durango" }
  312. location (path.join(_buildDir, "projects", _ACTION .. "-durango"))
  313. end
  314. elseif ("vs2012-xp") == _OPTIONS["vs"] then
  315. premake.vstudio.toolset = ("v110_xp")
  316. location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
  317. elseif "vs2013-xp" == _OPTIONS["vs"] then
  318. premake.vstudio.toolset = ("v120_xp")
  319. location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
  320. elseif "vs2015-xp" == _OPTIONS["vs"] then
  321. premake.vstudio.toolset = ("v140_xp")
  322. location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
  323. elseif _ACTION == "xcode4" then
  324. if "osx" == _OPTIONS["xcode"] then
  325. premake.xcode.toolset = "macosx"
  326. location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
  327. elseif "ios" == _OPTIONS["xcode"] then
  328. premake.xcode.toolset = "iphoneos"
  329. location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
  330. elseif "tvos" == _OPTIONS["xcode"] then
  331. premake.xcode.toolset = "appletvos"
  332. location (path.join(_buildDir, "projects", _ACTION .. "-tvos"))
  333. end
  334. end
  335. if not _OPTIONS["with-dynamic-runtime"] then
  336. flags { "StaticRuntime" }
  337. end
  338. flags {
  339. "NoPCH",
  340. "NativeWChar",
  341. "NoRTTI",
  342. "NoExceptions",
  343. "NoEditAndContinue",
  344. "Symbols",
  345. }
  346. defines {
  347. "__STDC_LIMIT_MACROS",
  348. "__STDC_FORMAT_MACROS",
  349. "__STDC_CONSTANT_MACROS",
  350. }
  351. configuration { "Debug" }
  352. targetsuffix "Debug"
  353. configuration { "Release" }
  354. flags {
  355. "NoBufferSecurityCheck",
  356. "OptimizeSpeed",
  357. }
  358. targetsuffix "Release"
  359. configuration { "vs*", "x32" }
  360. flags {
  361. "EnableSSE2",
  362. }
  363. configuration { "vs*" }
  364. includedirs { path.join(bxDir, "include/compat/msvc") }
  365. defines {
  366. "WIN32",
  367. "_WIN32",
  368. "_HAS_EXCEPTIONS=0",
  369. "_HAS_ITERATOR_DEBUGGING=0",
  370. "_SCL_SECURE=0",
  371. "_SECURE_SCL=0",
  372. "_SCL_SECURE_NO_WARNINGS",
  373. "_CRT_SECURE_NO_WARNINGS",
  374. "_CRT_SECURE_NO_DEPRECATE",
  375. }
  376. buildoptions {
  377. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  378. "/Ob2", -- The Inline Function Expansion
  379. }
  380. linkoptions {
  381. "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
  382. }
  383. configuration { "vs2008" }
  384. includedirs { path.join(bxDir, "include/compat/msvc/pre1600") }
  385. configuration { "x32", "vs*" }
  386. targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin"))
  387. objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
  388. libdirs {
  389. path.join(_libDir, "lib/win32_" .. _ACTION),
  390. }
  391. configuration { "x64", "vs*" }
  392. defines { "_WIN64" }
  393. targetdir (path.join(_buildDir, "win64_" .. _ACTION, "bin"))
  394. objdir (path.join(_buildDir, "win64_" .. _ACTION, "obj"))
  395. libdirs {
  396. path.join(_libDir, "lib/win64_" .. _ACTION),
  397. }
  398. configuration { "ARM", "vs*" }
  399. targetdir (path.join(_buildDir, "arm_" .. _ACTION, "bin"))
  400. objdir (path.join(_buildDir, "arm_" .. _ACTION, "obj"))
  401. configuration { "vs*-clang" }
  402. buildoptions {
  403. "-Qunused-arguments",
  404. }
  405. configuration { "x32", "vs*-clang" }
  406. targetdir (path.join(_buildDir, "win32_" .. _ACTION .. "-clang/bin"))
  407. objdir (path.join(_buildDir, "win32_" .. _ACTION .. "-clang/obj"))
  408. configuration { "x64", "vs*-clang" }
  409. targetdir (path.join(_buildDir, "win64_" .. _ACTION .. "-clang/bin"))
  410. objdir (path.join(_buildDir, "win64_" .. _ACTION .. "-clang/obj"))
  411. configuration { "winphone8* or winstore8*" }
  412. removeflags {
  413. "StaticRuntime",
  414. "NoExceptions",
  415. }
  416. configuration { "*-gcc* or osx" }
  417. buildoptions {
  418. "-Wshadow",
  419. }
  420. configuration { "mingw-*" }
  421. defines { "WIN32" }
  422. includedirs { path.join(bxDir, "include/compat/mingw") }
  423. buildoptions {
  424. "-Wunused-value",
  425. "-fdata-sections",
  426. "-ffunction-sections",
  427. "-msse2",
  428. "-Wunused-value",
  429. "-Wundef",
  430. }
  431. buildoptions_cpp {
  432. "-std=c++0x",
  433. }
  434. linkoptions {
  435. "-Wl,--gc-sections",
  436. "-static",
  437. "-static-libgcc",
  438. "-static-libstdc++",
  439. }
  440. configuration { "x32", "mingw-gcc" }
  441. targetdir (path.join(_buildDir, "win32_mingw-gcc/bin"))
  442. objdir (path.join(_buildDir, "win32_mingw-gcc/obj"))
  443. libdirs {
  444. path.join(_libDir, "lib/win32_mingw-gcc"),
  445. }
  446. buildoptions {
  447. "-m32",
  448. "-mstackrealign",
  449. }
  450. configuration { "x64", "mingw-gcc" }
  451. targetdir (path.join(_buildDir, "win64_mingw-gcc/bin"))
  452. objdir (path.join(_buildDir, "win64_mingw-gcc/obj"))
  453. libdirs {
  454. path.join(_libDir, "lib/win64_mingw-gcc"),
  455. }
  456. buildoptions { "-m64" }
  457. configuration { "mingw-clang" }
  458. buildoptions {
  459. "-isystem$(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++",
  460. "-isystem$(MINGW)/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32",
  461. "-isystem$(MINGW)/x86_64-w64-mingw32/include",
  462. }
  463. linkoptions {
  464. "-Qunused-arguments",
  465. "-Wno-error=unused-command-line-argument-hard-error-in-future",
  466. }
  467. configuration { "x32", "mingw-clang" }
  468. targetdir (path.join(_buildDir, "win32_mingw-clang/bin"))
  469. objdir (path.join(_buildDir, "win32_mingw-clang/obj"))
  470. libdirs {
  471. path.join(_libDir, "lib/win32_mingw-clang"),
  472. }
  473. buildoptions { "-m32" }
  474. configuration { "x64", "mingw-clang" }
  475. targetdir (path.join(_buildDir, "win64_mingw-clang/bin"))
  476. objdir (path.join(_buildDir, "win64_mingw-clang/obj"))
  477. libdirs {
  478. path.join(_libDir, "lib/win64_mingw-clang"),
  479. }
  480. buildoptions { "-m64" }
  481. configuration { "linux-clang" }
  482. configuration { "linux-gcc-5" }
  483. buildoptions {
  484. -- "-fno-omit-frame-pointer",
  485. -- "-fsanitize=address",
  486. -- "-fsanitize=undefined",
  487. -- "-fsanitize=float-divide-by-zero",
  488. -- "-fsanitize=float-cast-overflow",
  489. }
  490. links {
  491. -- "asan",
  492. -- "ubsan",
  493. }
  494. configuration { "linux-gcc" }
  495. buildoptions {
  496. "-mfpmath=sse",
  497. }
  498. configuration { "linux-gcc or linux-clang" }
  499. buildoptions {
  500. "-msse2",
  501. "-Wunused-value",
  502. "-Wundef",
  503. }
  504. buildoptions_cpp {
  505. "-std=c++0x",
  506. }
  507. links {
  508. "rt",
  509. "dl",
  510. }
  511. linkoptions {
  512. "-Wl,--gc-sections",
  513. }
  514. configuration { "linux-gcc*", "x32" }
  515. targetdir (path.join(_buildDir, "linux32_gcc/bin"))
  516. objdir (path.join(_buildDir, "linux32_gcc/obj"))
  517. libdirs { path.join(_libDir, "lib/linux32_gcc") }
  518. buildoptions {
  519. "-m32",
  520. }
  521. configuration { "linux-gcc*", "x64" }
  522. targetdir (path.join(_buildDir, "linux64_gcc/bin"))
  523. objdir (path.join(_buildDir, "linux64_gcc/obj"))
  524. libdirs { path.join(_libDir, "lib/linux64_gcc") }
  525. buildoptions {
  526. "-m64",
  527. }
  528. configuration { "linux-clang", "x32" }
  529. targetdir (path.join(_buildDir, "linux32_clang/bin"))
  530. objdir (path.join(_buildDir, "linux32_clang/obj"))
  531. libdirs { path.join(_libDir, "lib/linux32_clang") }
  532. buildoptions {
  533. "-m32",
  534. }
  535. configuration { "linux-clang", "x64" }
  536. targetdir (path.join(_buildDir, "linux64_clang/bin"))
  537. objdir (path.join(_buildDir, "linux64_clang/obj"))
  538. libdirs { path.join(_libDir, "lib/linux64_clang") }
  539. buildoptions {
  540. "-m64",
  541. }
  542. configuration { "linux-mips-gcc" }
  543. targetdir (path.join(_buildDir, "linux32_mips_gcc/bin"))
  544. objdir (path.join(_buildDir, "linux32_mips_gcc/obj"))
  545. libdirs { path.join(_libDir, "lib/linux32_mips_gcc") }
  546. buildoptions {
  547. "-Wunused-value",
  548. "-Wundef",
  549. }
  550. buildoptions_cpp {
  551. "-std=c++0x",
  552. }
  553. links {
  554. "rt",
  555. "dl",
  556. }
  557. linkoptions {
  558. "-Wl,--gc-sections",
  559. }
  560. configuration { "linux-arm-gcc" }
  561. targetdir (path.join(_buildDir, "linux32_arm_gcc/bin"))
  562. objdir (path.join(_buildDir, "linux32_arm_gcc/obj"))
  563. libdirs { path.join(_libDir, "lib/linux32_arm_gcc") }
  564. buildoptions {
  565. "-Wunused-value",
  566. "-Wundef",
  567. }
  568. buildoptions_cpp {
  569. "-std=c++0x",
  570. }
  571. links {
  572. "rt",
  573. "dl",
  574. }
  575. linkoptions {
  576. "-Wl,--gc-sections",
  577. }
  578. configuration { "android-*" }
  579. targetprefix ("lib")
  580. flags {
  581. "NoImportLib",
  582. }
  583. includedirs {
  584. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
  585. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  586. }
  587. linkoptions {
  588. "-nostdlib",
  589. "-static-libgcc",
  590. }
  591. links {
  592. "c",
  593. "dl",
  594. "m",
  595. "android",
  596. "log",
  597. "gnustl_static",
  598. "gcc",
  599. }
  600. buildoptions {
  601. "-fPIC",
  602. "-no-canonical-prefixes",
  603. "-Wa,--noexecstack",
  604. "-fstack-protector",
  605. "-ffunction-sections",
  606. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  607. "-Wunused-value",
  608. "-Wundef",
  609. }
  610. buildoptions_cpp {
  611. "-std=c++0x",
  612. }
  613. linkoptions {
  614. "-no-canonical-prefixes",
  615. "-Wl,--no-undefined",
  616. "-Wl,-z,noexecstack",
  617. "-Wl,-z,relro",
  618. "-Wl,-z,now",
  619. }
  620. configuration { "linux-steamlink" }
  621. targetdir (path.join(_buildDir, "steamlink/bin"))
  622. objdir (path.join(_buildDir, "steamlink/obj"))
  623. libdirs { path.join(_libDir, "lib/steamlink") }
  624. includedirs { path.join(bxDir, "include/compat/linux") }
  625. defines {
  626. "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it.
  627. }
  628. buildoptions {
  629. "-std=c++0x",
  630. "-Wfatal-errors",
  631. "-Wunused-value",
  632. "-Wundef",
  633. "-pthread",
  634. "-marm",
  635. "-mfloat-abi=hard",
  636. "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
  637. }
  638. linkoptions {
  639. "-static-libgcc",
  640. "-static-libstdc++",
  641. "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
  642. }
  643. configuration { "android-arm" }
  644. targetdir (path.join(_buildDir, "android-arm/bin"))
  645. objdir (path.join(_buildDir, "android-arm/obj"))
  646. libdirs {
  647. path.join(_libDir, "lib/android-arm"),
  648. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a",
  649. }
  650. includedirs {
  651. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include",
  652. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include",
  653. }
  654. buildoptions {
  655. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
  656. "-mthumb",
  657. "-march=armv7-a",
  658. "-mfloat-abi=softfp",
  659. "-mfpu=neon",
  660. "-Wunused-value",
  661. "-Wundef",
  662. }
  663. linkoptions {
  664. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
  665. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtbegin_so.o"),
  666. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtend_so.o"),
  667. "-march=armv7-a",
  668. "-Wl,--fix-cortex-a8",
  669. }
  670. configuration { "android-mips" }
  671. targetdir (path.join(_buildDir, "android-mips/bin"))
  672. objdir (path.join(_buildDir, "android-mips/obj"))
  673. libdirs {
  674. path.join(_libDir, "lib/android-mips"),
  675. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips",
  676. }
  677. includedirs {
  678. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include",
  679. }
  680. buildoptions {
  681. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
  682. "-Wunused-value",
  683. "-Wundef",
  684. }
  685. linkoptions {
  686. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
  687. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtbegin_so.o"),
  688. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtend_so.o"),
  689. }
  690. configuration { "android-x86" }
  691. targetdir (path.join(_buildDir, "android-x86/bin"))
  692. objdir (path.join(_buildDir, "android-x86/obj"))
  693. libdirs {
  694. path.join(_libDir, "lib/android-x86"),
  695. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86",
  696. }
  697. includedirs {
  698. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include",
  699. }
  700. buildoptions {
  701. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
  702. "-march=i686",
  703. "-mtune=atom",
  704. "-mstackrealign",
  705. "-msse3",
  706. "-mfpmath=sse",
  707. "-Wunused-value",
  708. "-Wundef",
  709. }
  710. linkoptions {
  711. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
  712. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtbegin_so.o"),
  713. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtend_so.o"),
  714. }
  715. configuration { "asmjs" }
  716. targetdir (path.join(_buildDir, "asmjs/bin"))
  717. objdir (path.join(_buildDir, "asmjs/obj"))
  718. libdirs { path.join(_libDir, "lib/asmjs") }
  719. buildoptions {
  720. "-isystem$(EMSCRIPTEN)/system/include",
  721. "-isystem$(EMSCRIPTEN)/system/include/libc",
  722. "-Wunused-value",
  723. "-Wundef",
  724. }
  725. configuration { "freebsd" }
  726. targetdir (path.join(_buildDir, "freebsd/bin"))
  727. objdir (path.join(_buildDir, "freebsd/obj"))
  728. libdirs { path.join(_libDir, "lib/freebsd") }
  729. includedirs {
  730. path.join(bxDir, "include/compat/freebsd"),
  731. }
  732. configuration { "nacl or nacl-arm or pnacl" }
  733. buildoptions {
  734. "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,...
  735. "-fno-stack-protector",
  736. "-fdiagnostics-show-option",
  737. "-fdata-sections",
  738. "-ffunction-sections",
  739. "-Wunused-value",
  740. "-Wundef",
  741. }
  742. buildoptions_cpp {
  743. "-std=c++0x",
  744. }
  745. includedirs {
  746. "$(NACL_SDK_ROOT)/include",
  747. path.join(bxDir, "include/compat/nacl"),
  748. }
  749. configuration { "nacl" }
  750. buildoptions {
  751. "-pthread",
  752. "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
  753. "-msse2",
  754. }
  755. linkoptions {
  756. "-Wl,--gc-sections",
  757. }
  758. configuration { "x32", "nacl" }
  759. targetdir (path.join(_buildDir, "nacl-x86/bin"))
  760. objdir (path.join(_buildDir, "nacl-x86/obj"))
  761. libdirs { path.join(_libDir, "lib/nacl-x86") }
  762. linkoptions { "-melf32_nacl" }
  763. configuration { "x32", "nacl", "Debug" }
  764. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Debug" }
  765. configuration { "x32", "nacl", "Release" }
  766. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Release" }
  767. configuration { "x64", "nacl" }
  768. targetdir (path.join(_buildDir, "nacl-x64/bin"))
  769. objdir (path.join(_buildDir, "nacl-x64/obj"))
  770. libdirs { path.join(_libDir, "lib/nacl-x64") }
  771. linkoptions { "-melf64_nacl" }
  772. configuration { "x64", "nacl", "Debug" }
  773. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_64/Debug" }
  774. configuration { "x64", "nacl", "Release" }
  775. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_64/Release" }
  776. configuration { "nacl-arm" }
  777. buildoptions {
  778. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  779. }
  780. targetdir (path.join(_buildDir, "nacl-arm/bin"))
  781. objdir (path.join(_buildDir, "nacl-arm/obj"))
  782. libdirs { path.join(_libDir, "lib/nacl-arm") }
  783. configuration { "nacl-arm", "Debug" }
  784. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Debug" }
  785. configuration { "nacl-arm", "Release" }
  786. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Release" }
  787. configuration { "pnacl" }
  788. targetdir (path.join(_buildDir, "pnacl/bin"))
  789. objdir (path.join(_buildDir, "pnacl/obj"))
  790. libdirs { path.join(_libDir, "lib/pnacl") }
  791. configuration { "pnacl", "Debug" }
  792. libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" }
  793. configuration { "pnacl", "Release" }
  794. libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" }
  795. configuration { "xbox360" }
  796. targetdir (path.join(_buildDir, "xbox360/bin"))
  797. objdir (path.join(_buildDir, "xbox360/obj"))
  798. includedirs { path.join(bxDir, "include/compat/msvc") }
  799. libdirs { path.join(_libDir, "lib/xbox360") }
  800. defines {
  801. "NOMINMAX",
  802. }
  803. configuration { "durango" }
  804. targetdir (path.join(_buildDir, "durango/bin"))
  805. objdir (path.join(_buildDir, "durango/obj"))
  806. includedirs { path.join(bxDir, "include/compat/msvc") }
  807. libdirs { path.join(_libDir, "lib/durango") }
  808. removeflags { "StaticRuntime" }
  809. defines {
  810. "NOMINMAX",
  811. }
  812. configuration { "osx", "x32" }
  813. targetdir (path.join(_buildDir, "osx32_clang/bin"))
  814. objdir (path.join(_buildDir, "osx32_clang/obj"))
  815. --libdirs { path.join(_libDir, "lib/osx32_clang") }
  816. buildoptions {
  817. "-m32",
  818. }
  819. configuration { "osx", "x64" }
  820. targetdir (path.join(_buildDir, "osx64_clang/bin"))
  821. objdir (path.join(_buildDir, "osx64_clang/obj"))
  822. --libdirs { path.join(_libDir, "lib/osx64_clang") }
  823. buildoptions {
  824. "-m64",
  825. }
  826. configuration { "osx", "Universal" }
  827. targetdir (path.join(_buildDir, "osx_universal/bin"))
  828. objdir (path.join(_buildDir, "osx_universal/bin"))
  829. configuration { "osx" }
  830. buildoptions {
  831. "-Wfatal-errors",
  832. "-msse2",
  833. "-Wunused-value",
  834. "-Wundef",
  835. }
  836. includedirs { path.join(bxDir, "include/compat/osx") }
  837. configuration { "ios*" }
  838. linkoptions {
  839. "-lc++",
  840. }
  841. buildoptions {
  842. "-Wfatal-errors",
  843. "-Wunused-value",
  844. "-Wundef",
  845. }
  846. includedirs { path.join(bxDir, "include/compat/ios") }
  847. configuration { "xcode4", "ios*" }
  848. targetdir (path.join(_buildDir, "ios-arm/bin"))
  849. objdir (path.join(_buildDir, "ios-arm/obj"))
  850. configuration { "ios-arm" }
  851. targetdir (path.join(_buildDir, "ios-arm/bin"))
  852. objdir (path.join(_buildDir, "ios-arm/obj"))
  853. libdirs { path.join(_libDir, "lib/ios-arm") }
  854. linkoptions {
  855. "-miphoneos-version-min=7.0",
  856. "-arch armv7",
  857. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk",
  858. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/usr/lib/system",
  859. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/Frameworks",
  860. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  861. }
  862. buildoptions {
  863. "-miphoneos-version-min=7.0",
  864. "-arch armv7",
  865. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk",
  866. }
  867. configuration { "ios-simulator" }
  868. targetdir (path.join(_buildDir, "ios-simulator/bin"))
  869. objdir (path.join(_buildDir, "ios-simulator/obj"))
  870. libdirs { path.join(_libDir, "lib/ios-simulator") }
  871. linkoptions {
  872. "-mios-simulator-version-min=7.0",
  873. "-arch i386",
  874. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
  875. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/usr/lib/system",
  876. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/Frameworks",
  877. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  878. }
  879. buildoptions {
  880. "-mios-simulator-version-min=7.0",
  881. "-arch i386",
  882. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
  883. }
  884. configuration { "tvos*" }
  885. linkoptions {
  886. "-lc++",
  887. }
  888. buildoptions {
  889. "-Wfatal-errors",
  890. "-Wunused-value",
  891. "-Wundef",
  892. }
  893. includedirs { path.join(bxDir, "include/compat/ios") }
  894. configuration { "xcode4", "tvos*" }
  895. targetdir (path.join(_buildDir, "tvos-arm64/bin"))
  896. objdir (path.join(_buildDir, "tvos-arm64/obj"))
  897. configuration { "tvos-arm64" }
  898. targetdir (path.join(_buildDir, "tvos-arm64/bin"))
  899. objdir (path.join(_buildDir, "tvos-arm64/obj"))
  900. libdirs { path.join(_libDir, "lib/tvos-arm64") }
  901. linkoptions {
  902. "-mtvos-version-min=9.0",
  903. "-arch arm64",
  904. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
  905. "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/usr/lib/system",
  906. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
  907. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  908. }
  909. buildoptions {
  910. "-mtvos-version-min=9.0",
  911. "-arch arm64",
  912. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
  913. }
  914. configuration { "tvos-simulator" }
  915. targetdir (path.join(_buildDir, "tvos-simulator/bin"))
  916. objdir (path.join(_buildDir, "tvos-simulator/obj"))
  917. libdirs { path.join(_libDir, "lib/tvos-simulator") }
  918. linkoptions {
  919. "-mtvos-simulator-version-min=9.0",
  920. "-arch i386",
  921. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
  922. "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/usr/lib/system",
  923. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
  924. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  925. }
  926. buildoptions {
  927. "-mtvos-simulator-version-min=9.0",
  928. "-arch i386",
  929. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
  930. }
  931. configuration { "ps4" }
  932. targetdir (path.join(_buildDir, "ps4/bin"))
  933. objdir (path.join(_buildDir, "ps4/obj"))
  934. libdirs { path.join(_libDir, "lib/ps4") }
  935. includedirs {
  936. path.join(bxDir, "include/compat/freebsd"),
  937. "$(PS4_SDK_ROOT)/target/include",
  938. "$(PS4_SDK_ROOT)/target/include_common",
  939. }
  940. buildoptions {
  941. }
  942. buildoptions_cpp {
  943. "-std=c++0x",
  944. }
  945. linkoptions {
  946. }
  947. configuration { "qnx-arm" }
  948. targetdir (path.join(_buildDir, "qnx-arm/bin"))
  949. objdir (path.join(_buildDir, "qnx-arm/obj"))
  950. libdirs { path.join(_libDir, "lib/qnx-arm") }
  951. -- includedirs { path.join(bxDir, "include/compat/qnx") }
  952. buildoptions {
  953. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  954. "-Wunused-value",
  955. "-Wundef",
  956. }
  957. buildoptions_cpp {
  958. "-std=c++0x",
  959. }
  960. configuration { "rpi" }
  961. targetdir (path.join(_buildDir, "rpi/bin"))
  962. objdir (path.join(_buildDir, "rpi/obj"))
  963. libdirs {
  964. path.join(_libDir, "lib/rpi"),
  965. "/opt/vc/lib",
  966. }
  967. defines {
  968. "__VCCOREVER__=0x04000000", -- There is no special prefedined compiler symbol to detect RaspberryPi, faking it.
  969. "__STDC_VERSION__=199901L",
  970. }
  971. buildoptions {
  972. "-Wunused-value",
  973. "-Wundef",
  974. }
  975. buildoptions_cpp {
  976. "-std=c++0x",
  977. }
  978. includedirs {
  979. "/opt/vc/include",
  980. "/opt/vc/include/interface/vcos/pthreads",
  981. "/opt/vc/include/interface/vmcs_host/linux",
  982. }
  983. links {
  984. "rt",
  985. }
  986. linkoptions {
  987. "-Wl,--gc-sections",
  988. }
  989. configuration { "riscv" }
  990. targetdir (path.join(_buildDir, "riscv/bin"))
  991. objdir (path.join(_buildDir, "riscv/obj"))
  992. includedirs {
  993. "$(RISCV_DIR)/sysroot/usr/include",
  994. }
  995. buildoptions {
  996. "-Wunused-value",
  997. "-Wundef",
  998. "--sysroot=$(RISCV_DIR)/sysroot",
  999. }
  1000. buildoptions_cpp {
  1001. "-std=c++0x",
  1002. }
  1003. configuration {} -- reset configuration
  1004. return true
  1005. end
  1006. function strip()
  1007. configuration { "android-arm", "Release" }
  1008. postbuildcommands {
  1009. "$(SILENT) echo Stripping symbols.",
  1010. "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
  1011. }
  1012. configuration { "android-mips", "Release" }
  1013. postbuildcommands {
  1014. "$(SILENT) echo Stripping symbols.",
  1015. "$(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\""
  1016. }
  1017. configuration { "android-x86", "Release" }
  1018. postbuildcommands {
  1019. "$(SILENT) echo Stripping symbols.",
  1020. "$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
  1021. }
  1022. configuration { "linux-steamlink", "Release" }
  1023. postbuildcommands {
  1024. "$(SILENT) echo Stripping symbols.",
  1025. "$(SILENT) $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-strip -s \"$(TARGET)\""
  1026. }
  1027. configuration { "linux-* or rpi", "not linux-steamlink", "Release" }
  1028. postbuildcommands {
  1029. "$(SILENT) echo Stripping symbols.",
  1030. "$(SILENT) strip -s \"$(TARGET)\""
  1031. }
  1032. configuration { "mingw*", "Release" }
  1033. postbuildcommands {
  1034. "$(SILENT) echo Stripping symbols.",
  1035. "$(SILENT) $(MINGW)/bin/strip -s \"$(TARGET)\""
  1036. }
  1037. configuration { "pnacl" }
  1038. postbuildcommands {
  1039. "$(SILENT) echo Running pnacl-finalize.",
  1040. "$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\""
  1041. }
  1042. configuration { "*nacl*", "Release" }
  1043. postbuildcommands {
  1044. "$(SILENT) echo Stripping symbols.",
  1045. "$(SILENT) " .. naclToolchain .. "strip -s \"$(TARGET)\""
  1046. }
  1047. configuration { "asmjs" }
  1048. postbuildcommands {
  1049. "$(SILENT) echo Running asmjs finalize.",
  1050. "$(SILENT) $(EMSCRIPTEN)/emcc -O2 "
  1051. -- .. "-s EMTERPRETIFY=1 "
  1052. -- .. "-s EMTERPRETIFY_ASYNC=1 "
  1053. .. "-s TOTAL_MEMORY=268435456 "
  1054. -- .. "-s ALLOW_MEMORY_GROWTH=1 "
  1055. -- .. "-s USE_WEBGL2=1 "
  1056. .. "--memory-init-file 1 "
  1057. .. "\"$(TARGET)\" -o \"$(TARGET)\".html "
  1058. -- .. "--preload-file ../../../examples/runtime@/"
  1059. }
  1060. configuration {} -- reset configuration
  1061. end