toolchain.lua 36 KB

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