toolchain.lua 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. --
  2. -- Copyright 2010-2013 Branimir Karadzic. All rights reserved.
  3. -- License: http://www.opensource.org/licenses/BSD-2-Clause
  4. --
  5. local bxDir = (path.getabsolute("..") .. "/")
  6. function toolchain(_buildDir, _libDir)
  7. newoption {
  8. trigger = "gcc",
  9. value = "GCC",
  10. description = "Choose GCC flavor",
  11. allowed = {
  12. { "android-arm", "Android - ARM" },
  13. -- { "emscripten-experimental", "Emscripten" },
  14. { "linux", "Linux" },
  15. { "linux-clang", "Linux (Clang compiler)" },
  16. { "mingw", "MinGW" },
  17. { "nacl", "Native Client" },
  18. { "nacl-arm", "Native Client - ARM" },
  19. { "pnacl", "Native Client - PNaCl" },
  20. { "osx", "OSX" },
  21. { "ios-arm", "iOS - ARM" },
  22. { "ios-simulator", "iOS - Simulator" },
  23. { "qnx-arm", "QNX/Blackberry - ARM" },
  24. }
  25. }
  26. -- Avoid error when invoking premake4 --help.
  27. if (_ACTION == nil) then return end
  28. location (_buildDir .. "projects/" .. _ACTION)
  29. if _ACTION == "clean" then
  30. os.rmdir(BUILD_DIR)
  31. end
  32. if _ACTION == "gmake" then
  33. if nil == _OPTIONS["gcc"] then
  34. print("GCC flavor must be specified!")
  35. os.exit(1)
  36. end
  37. flags {
  38. "ExtraWarnings",
  39. }
  40. if "android-arm" == _OPTIONS["gcc"] then
  41. if not os.getenv("ANDROID_NDK_ARM") or not os.getenv("ANDROID_NDK_ROOT") then
  42. print("Set ANDROID_NDK_ARM and ANDROID_NDK_ROOT envrionment variables.")
  43. end
  44. premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
  45. premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
  46. premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
  47. location (_buildDir .. "projects/" .. _ACTION .. "-android-arm")
  48. end
  49. if "emscripten-experimental" == _OPTIONS["gcc"] then
  50. if not os.getenv("EMSCRIPTEN") then
  51. print("Set EMSCRIPTEN enviroment variables.")
  52. end
  53. premake.gcc.cc = "$(EMSCRIPTEN)/emcc"
  54. premake.gcc.cxx = "$(EMSCRIPTEN)/em++"
  55. premake.gcc.ar = "$(EMSCRIPTEN)/emar"
  56. location (_buildDir .. "projects/" .. _ACTION .. "-emscripten")
  57. end
  58. if "linux" == _OPTIONS["gcc"] then
  59. location (_buildDir .. "projects/" .. _ACTION .. "-linux")
  60. end
  61. if "linux-clang" == _OPTIONS["gcc"] then
  62. premake.gcc.cc = "clang"
  63. premake.gcc.cxx = "clang++"
  64. premake.gcc.ar = "ar"
  65. location (_buildDir .. "projects/" .. _ACTION .. "-linux-clang")
  66. end
  67. if "mingw" == _OPTIONS["gcc"] then
  68. premake.gcc.cc = "$(MINGW)/bin/mingw32-gcc"
  69. premake.gcc.cxx = "$(MINGW)/bin/mingw32-g++"
  70. premake.gcc.ar = "$(MINGW)/bin/ar"
  71. location (_buildDir .. "projects/" .. _ACTION .. "-mingw")
  72. end
  73. if "nacl" == _OPTIONS["gcc"] then
  74. if not os.getenv("NACL_SDK_ROOT") then
  75. print("Set NACL_SDK_ROOT enviroment variables.")
  76. end
  77. premake.gcc.cc = "$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-gcc"
  78. premake.gcc.cxx = "$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-g++"
  79. premake.gcc.ar = "$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-ar"
  80. location (_buildDir .. "projects/" .. _ACTION .. "-nacl")
  81. end
  82. if "nacl-arm" == _OPTIONS["gcc"] then
  83. if not os.getenv("NACL_SDK_ROOT") then
  84. print("Set NACL_SDK_ROOT enviroment variables.")
  85. end
  86. premake.gcc.cc = "$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-gcc"
  87. premake.gcc.cxx = "$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-g++"
  88. premake.gcc.ar = "$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-ar"
  89. location (_buildDir .. "projects/" .. _ACTION .. "-nacl-arm")
  90. end
  91. if "pnacl" == _OPTIONS["gcc"] then
  92. if not os.getenv("NACL_SDK_ROOT") then
  93. print("Set NACL_SDK_ROOT enviroment variables.")
  94. end
  95. premake.gcc.cc = "$(NACL_SDK_ROOT)/toolchain/win_x86_pnacl/newlib/bin/pnacl-clang"
  96. premake.gcc.cxx = "$(NACL_SDK_ROOT)/toolchain/win_x86_pnacl/newlib/bin/pnacl-clang++"
  97. premake.gcc.ar = "$(NACL_SDK_ROOT)/toolchain/win_x86_pnacl/newlib/bin/pnacl-ar"
  98. location (_buildDir .. "projects/" .. _ACTION .. "-pnacl")
  99. end
  100. if "osx" == _OPTIONS["gcc"] then
  101. location (_buildDir .. "projects/" .. _ACTION .. "-osx")
  102. end
  103. if "ios-arm" == _OPTIONS["gcc"] then
  104. premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
  105. premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-g++-4.2"
  106. premake.gcc.ar = "ar"
  107. location (_buildDir .. "projects/" .. _ACTION .. "-ios-arm")
  108. end
  109. if "ios-simulator" == _OPTIONS["gcc"] then
  110. premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/i686-apple-darwin11-llvm-gcc-4.2"
  111. premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/i686-apple-darwin11-llvm-g++-4.2"
  112. premake.gcc.ar = "ar"
  113. location (_buildDir .. "projects/" .. _ACTION .. "-ios-simulator")
  114. end
  115. if "qnx-arm" == _OPTIONS["gcc"] then
  116. if not os.getenv("QNX_HOST") then
  117. print("Set QNX_HOST enviroment variables.")
  118. end
  119. premake.gcc.cc = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc"
  120. premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++"
  121. premake.gcc.ar = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar"
  122. location (_buildDir .. "projects/" .. _ACTION .. "-qnx-arm")
  123. end
  124. end
  125. flags {
  126. "StaticRuntime",
  127. "NoMinimalRebuild",
  128. "NoPCH",
  129. "NativeWChar",
  130. "NoRTTI",
  131. "NoExceptions",
  132. "NoEditAndContinue",
  133. "Symbols",
  134. }
  135. defines {
  136. "__STDC_LIMIT_MACROS",
  137. "__STDC_FORMAT_MACROS",
  138. "__STDC_CONSTANT_MACROS",
  139. }
  140. configuration "Debug"
  141. targetsuffix "Debug"
  142. configuration "Release"
  143. flags {
  144. "OptimizeSpeed",
  145. }
  146. targetsuffix "Release"
  147. configuration { "vs*" }
  148. flags {
  149. "EnableSSE2",
  150. }
  151. includedirs { bxDir .. "include/compat/msvc" }
  152. defines {
  153. "WIN32",
  154. "_WIN32",
  155. "_HAS_EXCEPTIONS=0",
  156. "_HAS_ITERATOR_DEBUGGING=0",
  157. "_SCL_SECURE=0",
  158. "_SECURE_SCL=0",
  159. "_SCL_SECURE_NO_WARNINGS",
  160. "_CRT_SECURE_NO_WARNINGS",
  161. "_CRT_SECURE_NO_DEPRECATE",
  162. }
  163. buildoptions {
  164. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  165. "/Ob2", -- The Inline Function Expansion
  166. }
  167. linkoptions {
  168. "/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
  169. }
  170. configuration { "vs2008" }
  171. includedirs { bxDir .. "include/compat/msvc/pre1600" }
  172. configuration { "x32", "vs*" }
  173. targetdir (_buildDir .. "win32_" .. _ACTION .. "/bin")
  174. objdir (_buildDir .. "win32_" .. _ACTION .. "/obj")
  175. libdirs {
  176. _libDir .. "lib/win32_" .. _ACTION,
  177. "$(DXSDK_DIR)/lib/x86",
  178. }
  179. configuration { "x64", "vs*" }
  180. defines { "_WIN64" }
  181. targetdir (_buildDir .. "win64_" .. _ACTION .. "/bin")
  182. objdir (_buildDir .. "win64_" .. _ACTION .. "/obj")
  183. libdirs {
  184. _libDir .. "lib/win64_" .. _ACTION,
  185. "$(DXSDK_DIR)/lib/x64",
  186. }
  187. configuration { "mingw" }
  188. defines { "WIN32" }
  189. includedirs { bxDir .. "include/compat/mingw" }
  190. buildoptions {
  191. "-std=c++0x",
  192. "-U__STRICT_ANSI__",
  193. "-Wunused-value",
  194. "-fdata-sections",
  195. "-ffunction-sections",
  196. "-msse2",
  197. }
  198. linkoptions {
  199. "-Wl,--gc-sections",
  200. }
  201. configuration { "x32", "mingw" }
  202. targetdir (_buildDir .. "win32_mingw" .. "/bin")
  203. objdir (_buildDir .. "win32_mingw" .. "/obj")
  204. libdirs {
  205. _libDir .. "lib/win32_mingw",
  206. "$(DXSDK_DIR)/lib/x86",
  207. }
  208. buildoptions { "-m32" }
  209. configuration { "x64", "mingw" }
  210. targetdir (_buildDir .. "win64_mingw" .. "/bin")
  211. objdir (_buildDir .. "win64_mingw" .. "/obj")
  212. libdirs {
  213. _libDir .. "lib/win64_mingw",
  214. "$(DXSDK_DIR)/lib/x64",
  215. "$(GLES_X64_DIR)",
  216. }
  217. buildoptions { "-m64" }
  218. configuration { "linux and not linux-clang" }
  219. buildoptions {
  220. "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
  221. }
  222. configuration { "linux-clang" }
  223. buildoptions {
  224. "--analyze",
  225. }
  226. configuration { "linux or linux-clang" }
  227. buildoptions {
  228. "-std=c++0x",
  229. "-U__STRICT_ANSI__",
  230. "-Wunused-value",
  231. "-msse2",
  232. }
  233. links {
  234. "rt",
  235. }
  236. linkoptions {
  237. "-Wl,--gc-sections",
  238. }
  239. configuration { "linux", "x32" }
  240. targetdir (_buildDir .. "linux32_gcc" .. "/bin")
  241. objdir (_buildDir .. "linux32_gcc" .. "/obj")
  242. libdirs { _libDir .. "lib/linux32_gcc" }
  243. buildoptions {
  244. "-m32",
  245. }
  246. configuration { "linux", "x64" }
  247. targetdir (_buildDir .. "linux64_gcc" .. "/bin")
  248. objdir (_buildDir .. "linux64_gcc" .. "/obj")
  249. libdirs { _libDir .. "lib/linux64_gcc" }
  250. buildoptions {
  251. "-m64",
  252. }
  253. configuration { "linux-clang", "x32" }
  254. targetdir (_buildDir .. "linux32_clang" .. "/bin")
  255. objdir (_buildDir .. "linux32_clang" .. "/obj")
  256. libdirs { _libDir .. "lib/linux32_clang" }
  257. buildoptions {
  258. "-m32",
  259. }
  260. configuration { "linux-clang", "x64" }
  261. targetdir (_buildDir .. "linux64_clang" .. "/bin")
  262. objdir (_buildDir .. "linux64_clang" .. "/obj")
  263. libdirs { _libDir .. "lib/linux64_clang" }
  264. buildoptions {
  265. "-m64",
  266. }
  267. configuration { "android-arm" }
  268. targetdir (_buildDir .. "android-arm" .. "/bin")
  269. objdir (_buildDir .. "android-arm" .. "/obj")
  270. flags {
  271. "NoImportLib",
  272. }
  273. libdirs {
  274. _libDir .. "lib/android-arm",
  275. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a",
  276. }
  277. includedirs {
  278. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.7/include",
  279. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include",
  280. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  281. }
  282. linkoptions {
  283. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  284. "-nostdlib",
  285. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtbegin_so.o",
  286. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtend_so.o",
  287. "-march=armv7-a",
  288. -- "-Wl,-shared,-Bsymbolic",
  289. -- "-Wl,--gc-sections",
  290. "-Wl,--fix-cortex-a8",
  291. -- "-Wl,--no-undefined",
  292. "-static-libgcc",
  293. "-no-canonical-prefixes",
  294. "-Wl,--no-undefined",
  295. "-Wl,-z,noexecstack",
  296. "-Wl,-z,relro",
  297. "-Wl,-z,now",
  298. }
  299. links {
  300. "c",
  301. "m",
  302. "android",
  303. "log",
  304. "gnustl_static",
  305. "gcc",
  306. }
  307. buildoptions {
  308. "-std=c++0x",
  309. "-U__STRICT_ANSI__",
  310. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  311. "-fpic",
  312. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  313. "-mthumb",
  314. "-march=armv7-a",
  315. "-mfloat-abi=softfp",
  316. "-mfpu=vfpv3-d16",
  317. }
  318. configuration { "emscripten-experimental" }
  319. targetdir (_buildDir .. "emscripten" .. "/bin")
  320. objdir (_buildDir .. "emscripten" .. "/obj")
  321. libdirs { _libDir .. "lib/emscripten" }
  322. includedirs { "$(EMSCRIPTEN)/system/include" }
  323. buildoptions {
  324. "-pthread",
  325. }
  326. configuration { "nacl or nacl-arm or pnacl" }
  327. includedirs {
  328. "$(NACL_SDK_ROOT)/include",
  329. bxDir .. "include/compat/nacl",
  330. }
  331. configuration { "nacl" }
  332. buildoptions {
  333. "-std=c++0x",
  334. "-U__STRICT_ANSI__",
  335. "-pthread",
  336. "-fno-stack-protector",
  337. "-fdiagnostics-show-option",
  338. "-Wunused-value",
  339. "-fdata-sections",
  340. "-ffunction-sections",
  341. "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
  342. "-msse2",
  343. -- "-fmerge-all-constants",
  344. }
  345. linkoptions {
  346. "-Wl,--gc-sections",
  347. }
  348. configuration { "x32", "nacl" }
  349. targetdir (_buildDir .. "nacl-x86" .. "/bin")
  350. objdir (_buildDir .. "nacl-x86" .. "/obj")
  351. libdirs { _libDir .. "lib/nacl-x86" }
  352. linkoptions { "-melf32_nacl" }
  353. configuration { "x64", "nacl" }
  354. targetdir (_buildDir .. "nacl-x64" .. "/bin")
  355. objdir (_buildDir .. "nacl-x64" .. "/obj")
  356. libdirs { _libDir .. "lib/nacl-x64" }
  357. linkoptions { "-melf64_nacl" }
  358. configuration { "nacl-arm" }
  359. buildoptions {
  360. "-std=c++0x",
  361. "-U__STRICT_ANSI__",
  362. "-fno-stack-protector",
  363. "-fdiagnostics-show-option",
  364. "-Wunused-value",
  365. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  366. "-fdata-sections",
  367. "-ffunction-sections",
  368. }
  369. targetdir (_buildDir .. "nacl-arm" .. "/bin")
  370. objdir (_buildDir .. "nacl-arm" .. "/obj")
  371. libdirs { _libDir .. "lib/nacl-arm" }
  372. configuration { "pnacl" }
  373. buildoptions {
  374. "-std=c++0x",
  375. "-U__STRICT_ANSI__",
  376. "-fno-stack-protector",
  377. "-fdiagnostics-show-option",
  378. "-Wunused-value",
  379. "-fdata-sections",
  380. "-ffunction-sections",
  381. }
  382. targetdir (_buildDir .. "pnacl" .. "/bin")
  383. objdir (_buildDir .. "pnacl" .. "/obj")
  384. libdirs { _libDir .. "lib/pnacl" }
  385. includedirs { "$(PNACL)/sysroot/include" }
  386. configuration { "Xbox360" }
  387. targetdir (_buildDir .. "xbox360" .. "/bin")
  388. objdir (_buildDir .. "xbox360" .. "/obj")
  389. includedirs { bxDir .. "include/compat/msvc" }
  390. libdirs { _libDir .. "lib/xbox360" }
  391. defines {
  392. "NOMINMAX",
  393. "_XBOX",
  394. }
  395. configuration { "osx", "x32" }
  396. targetdir (_buildDir .. "osx32_gcc" .. "/bin")
  397. objdir (_buildDir .. "osx32_gcc" .. "/obj")
  398. libdirs { _libDir .. "lib/osx32_gcc" }
  399. buildoptions {
  400. "-m32",
  401. }
  402. configuration { "osx", "x64" }
  403. targetdir (_buildDir .. "osx64_gcc" .. "/bin")
  404. objdir (_buildDir .. "osx64_gcc" .. "/obj")
  405. libdirs { _libDir .. "lib/osx64_gcc" }
  406. buildoptions {
  407. "-m64",
  408. }
  409. configuration { "osx" }
  410. buildoptions {
  411. "-U__STRICT_ANSI__",
  412. "-Wfatal-errors",
  413. "-Wunused-value",
  414. "-msse2",
  415. }
  416. includedirs { bxDir .. "include/compat/osx" }
  417. configuration { "ios-arm" }
  418. targetdir (_buildDir .. "ios-arm" .. "/bin")
  419. objdir (_buildDir .. "ios-arm" .. "/obj")
  420. libdirs { _libDir .. "lib/ios-arm" }
  421. linkoptions {
  422. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk",
  423. "-march=armv7-a",
  424. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system",
  425. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks",
  426. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/PrivateFrameworks",
  427. }
  428. buildoptions {
  429. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk",
  430. "-mthumb",
  431. "-march=armv7-a",
  432. "-mfloat-abi=softfp",
  433. "-mfpu=neon",
  434. "-U__STRICT_ANSI__",
  435. "-Wfatal-errors",
  436. "-Wunused-value",
  437. }
  438. includedirs { bxDir .. "include/compat/osx" }
  439. configuration { "ios-simulator" }
  440. targetdir (_buildDir .. "ios-simulator" .. "/bin")
  441. objdir (_buildDir .. "ios-simulator" .. "/obj")
  442. libdirs { _libDir .. "lib/ios-simulator" }
  443. linkoptions {
  444. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk",
  445. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/lib/system",
  446. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks",
  447. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/PrivateFrameworks",
  448. }
  449. buildoptions {
  450. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk",
  451. "-miphoneos-version-min=3.0.0",
  452. "-fobjc-abi-version=2",
  453. "-fobjc-legacy-dispatch",
  454. "-U__STRICT_ANSI__",
  455. "-Wfatal-errors",
  456. "-Wunused-value",
  457. }
  458. includedirs { bxDir .. "include/compat/osx" }
  459. configuration { "qnx-arm" }
  460. targetdir (_buildDir .. "qnx-arm" .. "/bin")
  461. objdir (_buildDir .. "qnx-arm" .. "/obj")
  462. libdirs { _libDir .. "lib/qnx-arm" }
  463. -- includedirs { bxDir .. "include/compat/qnx" }
  464. buildoptions {
  465. "-std=c++0x",
  466. "-U__STRICT_ANSI__",
  467. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  468. }
  469. configuration {} -- reset configuration
  470. end
  471. function strip()
  472. configuration { "android*", "Release" }
  473. postbuildcommands {
  474. "@echo Stripping symbols.",
  475. "@$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
  476. }
  477. configuration { "linux", "Release" }
  478. postbuildcommands {
  479. "@echo Stripping symbols.",
  480. "@strip -s \"$(TARGET)\""
  481. }
  482. configuration { "mingw", "Release" }
  483. postbuildcommands {
  484. "@echo Stripping symbols.",
  485. "@$(MINGW)/bin/strip -s \"$(TARGET)\""
  486. }
  487. configuration { "nacl", "Release" }
  488. postbuildcommands {
  489. "@echo Stripping symbols.",
  490. "@$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-strip -s \"$(TARGET)\""
  491. }
  492. configuration { "nacl-arm", "Release" }
  493. postbuildcommands {
  494. "@echo Stripping symbols.",
  495. "@$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-strip -s \"$(TARGET)\""
  496. }
  497. configuration { "pnacl", "Release" }
  498. postbuildcommands {
  499. "@echo Stripping symbols.",
  500. "@$(NACL_SDK_ROOT)/toolchain/win_x86_pnacl/newlib/bin/pnacl-strip -s \"$(TARGET)\""
  501. }
  502. configuration {} -- reset configuration
  503. end