toolchain.lua 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  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. flags {
  556. "NoImportLib",
  557. }
  558. includedirs {
  559. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
  560. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  561. }
  562. linkoptions {
  563. "-nostdlib",
  564. "-static-libgcc",
  565. }
  566. links {
  567. "c",
  568. "dl",
  569. "m",
  570. "android",
  571. "log",
  572. "gnustl_static",
  573. "gcc",
  574. }
  575. buildoptions {
  576. "-fPIC",
  577. "-no-canonical-prefixes",
  578. "-Wa,--noexecstack",
  579. "-fstack-protector",
  580. "-ffunction-sections",
  581. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  582. "-Wunused-value",
  583. "-Wundef",
  584. }
  585. buildoptions_cpp {
  586. "-std=c++0x",
  587. }
  588. linkoptions {
  589. "-no-canonical-prefixes",
  590. "-Wl,--no-undefined",
  591. "-Wl,-z,noexecstack",
  592. "-Wl,-z,relro",
  593. "-Wl,-z,now",
  594. }
  595. configuration { "linux-steamlink" }
  596. targetdir (path.join(_buildDir, "steamlink/bin"))
  597. objdir (path.join(_buildDir, "steamlink/obj"))
  598. libdirs { path.join(_libDir, "lib/steamlink") }
  599. includedirs { path.join(bxDir, "include/compat/linux") }
  600. defines {
  601. "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it.
  602. }
  603. buildoptions {
  604. "-std=c++0x",
  605. "-Wfatal-errors",
  606. "-Wunused-value",
  607. "-Wundef",
  608. "-pthread",
  609. "-marm",
  610. "-mfloat-abi=hard",
  611. "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
  612. }
  613. linkoptions {
  614. "-static-libgcc",
  615. "-static-libstdc++",
  616. "--sysroot=$(MARVELL_SDK_PATH)/rootfs",
  617. }
  618. configuration { "android-arm" }
  619. targetdir (path.join(_buildDir, "android-arm/bin"))
  620. objdir (path.join(_buildDir, "android-arm/obj"))
  621. libdirs {
  622. path.join(_libDir, "lib/android-arm"),
  623. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
  624. }
  625. includedirs {
  626. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
  627. }
  628. buildoptions {
  629. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
  630. "-mthumb",
  631. "-march=armv7-a",
  632. "-mfloat-abi=softfp",
  633. "-mfpu=neon",
  634. "-Wunused-value",
  635. "-Wundef",
  636. }
  637. linkoptions {
  638. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
  639. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtbegin_so.o"),
  640. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtend_so.o"),
  641. "-march=armv7-a",
  642. "-Wl,--fix-cortex-a8",
  643. }
  644. configuration { "android-mips" }
  645. targetdir (path.join(_buildDir, "android-mips/bin"))
  646. objdir (path.join(_buildDir, "android-mips/obj"))
  647. libdirs {
  648. path.join(_libDir, "lib/android-mips"),
  649. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips",
  650. }
  651. includedirs {
  652. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include",
  653. }
  654. buildoptions {
  655. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
  656. "-Wunused-value",
  657. "-Wundef",
  658. }
  659. linkoptions {
  660. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
  661. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtbegin_so.o"),
  662. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtend_so.o"),
  663. }
  664. configuration { "android-x86" }
  665. targetdir (path.join(_buildDir, "android-x86/bin"))
  666. objdir (path.join(_buildDir, "android-x86/obj"))
  667. libdirs {
  668. path.join(_libDir, "lib/android-x86"),
  669. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86",
  670. }
  671. includedirs {
  672. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include",
  673. }
  674. buildoptions {
  675. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
  676. "-march=i686",
  677. "-mtune=atom",
  678. "-mstackrealign",
  679. "-msse3",
  680. "-mfpmath=sse",
  681. "-Wunused-value",
  682. "-Wundef",
  683. }
  684. linkoptions {
  685. "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
  686. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtbegin_so.o"),
  687. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "/arch-x86/usr/lib/crtend_so.o"),
  688. }
  689. configuration { "asmjs" }
  690. targetdir (path.join(_buildDir, "asmjs/bin"))
  691. objdir (path.join(_buildDir, "asmjs/obj"))
  692. libdirs { path.join(_libDir, "lib/asmjs") }
  693. buildoptions {
  694. "-isystem$(EMSCRIPTEN)/system/include",
  695. "-isystem$(EMSCRIPTEN)/system/include/libc",
  696. "-Wunused-value",
  697. "-Wundef",
  698. }
  699. configuration { "freebsd" }
  700. targetdir (path.join(_buildDir, "freebsd/bin"))
  701. objdir (path.join(_buildDir, "freebsd/obj"))
  702. libdirs { path.join(_libDir, "lib/freebsd") }
  703. includedirs {
  704. path.join(bxDir, "include/compat/freebsd"),
  705. }
  706. configuration { "nacl or nacl-arm or pnacl" }
  707. buildoptions {
  708. "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,...
  709. "-fno-stack-protector",
  710. "-fdiagnostics-show-option",
  711. "-fdata-sections",
  712. "-ffunction-sections",
  713. "-Wunused-value",
  714. "-Wundef",
  715. }
  716. buildoptions_cpp {
  717. "-std=c++0x",
  718. }
  719. includedirs {
  720. "$(NACL_SDK_ROOT)/include",
  721. path.join(bxDir, "include/compat/nacl"),
  722. }
  723. configuration { "nacl" }
  724. buildoptions {
  725. "-pthread",
  726. "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
  727. "-msse2",
  728. }
  729. linkoptions {
  730. "-Wl,--gc-sections",
  731. }
  732. configuration { "x32", "nacl" }
  733. targetdir (path.join(_buildDir, "nacl-x86/bin"))
  734. objdir (path.join(_buildDir, "nacl-x86/obj"))
  735. libdirs { path.join(_libDir, "lib/nacl-x86") }
  736. linkoptions { "-melf32_nacl" }
  737. configuration { "x32", "nacl", "Debug" }
  738. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Debug" }
  739. configuration { "x32", "nacl", "Release" }
  740. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Release" }
  741. configuration { "x64", "nacl" }
  742. targetdir (path.join(_buildDir, "nacl-x64/bin"))
  743. objdir (path.join(_buildDir, "nacl-x64/obj"))
  744. libdirs { path.join(_libDir, "lib/nacl-x64") }
  745. linkoptions { "-melf64_nacl" }
  746. configuration { "x64", "nacl", "Debug" }
  747. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_64/Debug" }
  748. configuration { "x64", "nacl", "Release" }
  749. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_64/Release" }
  750. configuration { "nacl-arm" }
  751. buildoptions {
  752. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  753. }
  754. targetdir (path.join(_buildDir, "nacl-arm/bin"))
  755. objdir (path.join(_buildDir, "nacl-arm/obj"))
  756. libdirs { path.join(_libDir, "lib/nacl-arm") }
  757. configuration { "nacl-arm", "Debug" }
  758. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Debug" }
  759. configuration { "nacl-arm", "Release" }
  760. libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Release" }
  761. configuration { "pnacl" }
  762. targetdir (path.join(_buildDir, "pnacl/bin"))
  763. objdir (path.join(_buildDir, "pnacl/obj"))
  764. libdirs { path.join(_libDir, "lib/pnacl") }
  765. configuration { "pnacl", "Debug" }
  766. libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" }
  767. configuration { "pnacl", "Release" }
  768. libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" }
  769. configuration { "Xbox360" }
  770. targetdir (path.join(_buildDir, "xbox360/bin"))
  771. objdir (path.join(_buildDir, "xbox360/obj"))
  772. includedirs { path.join(bxDir, "include/compat/msvc") }
  773. libdirs { path.join(_libDir, "lib/xbox360") }
  774. defines {
  775. "NOMINMAX",
  776. "_XBOX",
  777. }
  778. configuration { "osx", "x32" }
  779. targetdir (path.join(_buildDir, "osx32_clang/bin"))
  780. objdir (path.join(_buildDir, "osx32_clang/obj"))
  781. --libdirs { path.join(_libDir, "lib/osx32_clang") }
  782. buildoptions {
  783. "-m32",
  784. }
  785. configuration { "osx", "x64" }
  786. targetdir (path.join(_buildDir, "osx64_clang/bin"))
  787. objdir (path.join(_buildDir, "osx64_clang/obj"))
  788. --libdirs { path.join(_libDir, "lib/osx64_clang") }
  789. buildoptions {
  790. "-m64",
  791. }
  792. configuration { "osx", "Universal" }
  793. targetdir (path.join(_buildDir, "osx_universal/bin"))
  794. objdir (path.join(_buildDir, "osx_universal/bin"))
  795. configuration { "osx" }
  796. buildoptions {
  797. "-Wfatal-errors",
  798. "-msse2",
  799. "-Wunused-value",
  800. "-Wundef",
  801. }
  802. includedirs { path.join(bxDir, "include/compat/osx") }
  803. configuration { "ios*" }
  804. linkoptions {
  805. "-lc++",
  806. }
  807. buildoptions {
  808. "-Wfatal-errors",
  809. "-Wunused-value",
  810. "-Wundef",
  811. }
  812. includedirs { path.join(bxDir, "include/compat/ios") }
  813. configuration { "xcode4", "ios*" }
  814. targetdir (path.join(_buildDir, "ios-arm/bin"))
  815. objdir (path.join(_buildDir, "ios-arm/obj"))
  816. configuration { "ios-arm" }
  817. targetdir (path.join(_buildDir, "ios-arm/bin"))
  818. objdir (path.join(_buildDir, "ios-arm/obj"))
  819. libdirs { path.join(_libDir, "lib/ios-arm") }
  820. linkoptions {
  821. "-miphoneos-version-min=7.0",
  822. "-arch armv7",
  823. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk",
  824. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/usr/lib/system",
  825. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/Frameworks",
  826. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  827. }
  828. buildoptions {
  829. "-miphoneos-version-min=7.0",
  830. "-arch armv7",
  831. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" ..iosPlatform .. ".sdk",
  832. }
  833. configuration { "ios-simulator" }
  834. targetdir (path.join(_buildDir, "ios-simulator/bin"))
  835. objdir (path.join(_buildDir, "ios-simulator/obj"))
  836. libdirs { path.join(_libDir, "lib/ios-simulator") }
  837. linkoptions {
  838. "-mios-simulator-version-min=7.0",
  839. "-arch i386",
  840. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
  841. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/usr/lib/system",
  842. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/Frameworks",
  843. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  844. }
  845. buildoptions {
  846. "-mios-simulator-version-min=7.0",
  847. "-arch i386",
  848. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
  849. }
  850. configuration { "tvos*" }
  851. linkoptions {
  852. "-lc++",
  853. }
  854. buildoptions {
  855. "-Wfatal-errors",
  856. "-Wunused-value",
  857. "-Wundef",
  858. }
  859. includedirs { path.join(bxDir, "include/compat/ios") }
  860. configuration { "xcode4", "tvos*" }
  861. targetdir (path.join(_buildDir, "tvos-arm64/bin"))
  862. objdir (path.join(_buildDir, "tvos-arm64/obj"))
  863. configuration { "tvos-arm64" }
  864. targetdir (path.join(_buildDir, "tvos-arm64/bin"))
  865. objdir (path.join(_buildDir, "tvos-arm64/obj"))
  866. libdirs { path.join(_libDir, "lib/tvos-arm64") }
  867. linkoptions {
  868. "-mtvos-version-min=9.0",
  869. "-arch arm64",
  870. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
  871. "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/usr/lib/system",
  872. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
  873. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  874. }
  875. buildoptions {
  876. "-mtvos-version-min=9.0",
  877. "-arch arm64",
  878. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
  879. }
  880. configuration { "tvos-simulator" }
  881. targetdir (path.join(_buildDir, "tvos-simulator/bin"))
  882. objdir (path.join(_buildDir, "tvos-simulator/obj"))
  883. libdirs { path.join(_libDir, "lib/tvos-simulator") }
  884. linkoptions {
  885. "-mtvos-simulator-version-min=9.0",
  886. "-arch i386",
  887. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
  888. "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/usr/lib/system",
  889. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
  890. "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
  891. }
  892. buildoptions {
  893. "-mtvos-simulator-version-min=9.0",
  894. "-arch i386",
  895. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
  896. }
  897. configuration { "ps4" }
  898. targetdir (path.join(_buildDir, "ps4/bin"))
  899. objdir (path.join(_buildDir, "ps4/obj"))
  900. libdirs { path.join(_libDir, "lib/ps4") }
  901. includedirs {
  902. path.join(bxDir, "include/compat/freebsd"),
  903. "$(PS4_SDK_ROOT)/target/include",
  904. "$(PS4_SDK_ROOT)/target/include_common",
  905. }
  906. buildoptions {
  907. }
  908. buildoptions_cpp {
  909. "-std=c++0x",
  910. }
  911. linkoptions {
  912. }
  913. configuration { "qnx-arm" }
  914. targetdir (path.join(_buildDir, "qnx-arm/bin"))
  915. objdir (path.join(_buildDir, "qnx-arm/obj"))
  916. libdirs { path.join(_libDir, "lib/qnx-arm") }
  917. -- includedirs { path.join(bxDir, "include/compat/qnx") }
  918. buildoptions {
  919. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  920. "-Wunused-value",
  921. "-Wundef",
  922. }
  923. buildoptions_cpp {
  924. "-std=c++0x",
  925. }
  926. configuration { "rpi" }
  927. targetdir (path.join(_buildDir, "rpi/bin"))
  928. objdir (path.join(_buildDir, "rpi/obj"))
  929. libdirs {
  930. path.join(_libDir, "lib/rpi"),
  931. "/opt/vc/lib",
  932. }
  933. defines {
  934. "__VCCOREVER__=0x04000000", -- There is no special prefedined compiler symbol to detect RaspberryPi, faking it.
  935. "__STDC_VERSION__=199901L",
  936. }
  937. buildoptions {
  938. "-Wunused-value",
  939. "-Wundef",
  940. }
  941. buildoptions_cpp {
  942. "-std=c++0x",
  943. }
  944. includedirs {
  945. "/opt/vc/include",
  946. "/opt/vc/include/interface/vcos/pthreads",
  947. "/opt/vc/include/interface/vmcs_host/linux",
  948. }
  949. links {
  950. "rt",
  951. }
  952. linkoptions {
  953. "-Wl,--gc-sections",
  954. }
  955. configuration {} -- reset configuration
  956. return true
  957. end
  958. function strip()
  959. configuration { "android-arm", "Release" }
  960. postbuildcommands {
  961. "$(SILENT) echo Stripping symbols.",
  962. "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
  963. }
  964. configuration { "android-mips", "Release" }
  965. postbuildcommands {
  966. "$(SILENT) echo Stripping symbols.",
  967. "$(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\""
  968. }
  969. configuration { "android-x86", "Release" }
  970. postbuildcommands {
  971. "$(SILENT) echo Stripping symbols.",
  972. "$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
  973. }
  974. configuration { "linux-* or rpi", "Release" }
  975. postbuildcommands {
  976. "$(SILENT) echo Stripping symbols.",
  977. "$(SILENT) strip -s \"$(TARGET)\""
  978. }
  979. configuration { "mingw*", "Release" }
  980. postbuildcommands {
  981. "$(SILENT) echo Stripping symbols.",
  982. "$(SILENT) $(MINGW)/bin/strip -s \"$(TARGET)\""
  983. }
  984. configuration { "pnacl" }
  985. postbuildcommands {
  986. "$(SILENT) echo Running pnacl-finalize.",
  987. "$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\""
  988. }
  989. configuration { "*nacl*", "Release" }
  990. postbuildcommands {
  991. "$(SILENT) echo Stripping symbols.",
  992. "$(SILENT) " .. naclToolchain .. "strip -s \"$(TARGET)\""
  993. }
  994. configuration { "asmjs" }
  995. postbuildcommands {
  996. "$(SILENT) echo Running asmjs finalize.",
  997. "$(SILENT) $(EMSCRIPTEN)/emcc -O2 "
  998. -- .. "-s EMTERPRETIFY=1 "
  999. -- .. "-s EMTERPRETIFY_ASYNC=1 "
  1000. .. "-s TOTAL_MEMORY=268435456 "
  1001. -- .. "-s ALLOW_MEMORY_GROWTH=1 "
  1002. .. "--memory-init-file 1 "
  1003. .. "\"$(TARGET)\" -o \"$(TARGET)\".html "
  1004. -- .. "--preload-file ../../../examples/runtime@/"
  1005. }
  1006. configuration {} -- reset configuration
  1007. end