toolchain.lua 37 KB

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