toolchain.lua 38 KB

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