toolchain.lua 36 KB

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