toolchain.lua 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  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. includedirs { bxDir .. "include/compat/msvc" }
  149. defines {
  150. "WIN32",
  151. "_WIN32",
  152. "_HAS_EXCEPTIONS=0",
  153. "_HAS_ITERATOR_DEBUGGING=0",
  154. "_SCL_SECURE=0",
  155. "_SECURE_SCL=0",
  156. "_SCL_SECURE_NO_WARNINGS",
  157. "_CRT_SECURE_NO_WARNINGS",
  158. "_CRT_SECURE_NO_DEPRECATE",
  159. }
  160. buildoptions {
  161. "/Oy-", -- Suppresses creation of frame pointers on the call stack.
  162. "/Ob2", -- The Inline Function Expansion
  163. }
  164. configuration { "x32", "vs*" }
  165. targetdir (_buildDir .. "win32_" .. _ACTION .. "/bin")
  166. objdir (_buildDir .. "win32_" .. _ACTION .. "/obj")
  167. libdirs {
  168. _libDir .. "lib/win32_" .. _ACTION,
  169. "$(DXSDK_DIR)/lib/x86",
  170. }
  171. configuration { "x64", "vs*" }
  172. defines { "_WIN64" }
  173. targetdir (_buildDir .. "win64_" .. _ACTION .. "/bin")
  174. objdir (_buildDir .. "win64_" .. _ACTION .. "/obj")
  175. libdirs {
  176. _libDir .. "lib/win64_" .. _ACTION,
  177. "$(DXSDK_DIR)/lib/x64",
  178. }
  179. configuration { "mingw" }
  180. defines { "WIN32" }
  181. includedirs { bxDir .. "include/compat/mingw" }
  182. buildoptions {
  183. "-std=c++0x",
  184. "-U__STRICT_ANSI__",
  185. "-Wunused-value",
  186. "-fdata-sections",
  187. "-ffunction-sections",
  188. }
  189. linkoptions {
  190. "-Wl,--gc-sections",
  191. }
  192. configuration { "x32", "mingw" }
  193. targetdir (_buildDir .. "win32_mingw" .. "/bin")
  194. objdir (_buildDir .. "win32_mingw" .. "/obj")
  195. libdirs {
  196. _libDir .. "lib/win32_mingw",
  197. "$(DXSDK_DIR)/lib/x86",
  198. }
  199. buildoptions { "-m32" }
  200. configuration { "x64", "mingw" }
  201. targetdir (_buildDir .. "win64_mingw" .. "/bin")
  202. objdir (_buildDir .. "win64_mingw" .. "/obj")
  203. libdirs {
  204. _libDir .. "lib/win64_mingw",
  205. "$(DXSDK_DIR)/lib/x64",
  206. "$(GLES_X64_DIR)",
  207. }
  208. buildoptions { "-m64" }
  209. configuration { "linux and not linux-clang" }
  210. buildoptions {
  211. "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
  212. }
  213. configuration { "linux-clang" }
  214. buildoptions {
  215. "--analyze",
  216. }
  217. configuration { "linux or linux-clang" }
  218. buildoptions {
  219. "-std=c++0x",
  220. "-U__STRICT_ANSI__",
  221. "-Wunused-value",
  222. "-msse2",
  223. }
  224. links {
  225. "rt",
  226. }
  227. linkoptions {
  228. "-Wl,--gc-sections",
  229. }
  230. configuration { "linux", "x32" }
  231. targetdir (_buildDir .. "linux32_gcc" .. "/bin")
  232. objdir (_buildDir .. "linux32_gcc" .. "/obj")
  233. libdirs { _libDir .. "lib/linux32_gcc" }
  234. buildoptions {
  235. "-m32",
  236. }
  237. configuration { "linux", "x64" }
  238. targetdir (_buildDir .. "linux64_gcc" .. "/bin")
  239. objdir (_buildDir .. "linux64_gcc" .. "/obj")
  240. libdirs { _libDir .. "lib/linux64_gcc" }
  241. buildoptions {
  242. "-m64",
  243. }
  244. configuration { "linux-clang", "x32" }
  245. targetdir (_buildDir .. "linux32_clang" .. "/bin")
  246. objdir (_buildDir .. "linux32_clang" .. "/obj")
  247. libdirs { _libDir .. "lib/linux32_clang" }
  248. buildoptions {
  249. "-m32",
  250. }
  251. configuration { "linux-clang", "x64" }
  252. targetdir (_buildDir .. "linux64_clang" .. "/bin")
  253. objdir (_buildDir .. "linux64_clang" .. "/obj")
  254. libdirs { _libDir .. "lib/linux64_clang" }
  255. buildoptions {
  256. "-m64",
  257. }
  258. configuration { "android-arm" }
  259. targetdir (_buildDir .. "android-arm" .. "/bin")
  260. objdir (_buildDir .. "android-arm" .. "/obj")
  261. flags {
  262. "NoImportLib",
  263. }
  264. libdirs {
  265. _libDir .. "lib/android-arm",
  266. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a",
  267. }
  268. includedirs {
  269. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.7/include",
  270. "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include",
  271. "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
  272. }
  273. linkoptions {
  274. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  275. "-nostdlib",
  276. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtbegin_so.o",
  277. "$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm/usr/lib/crtend_so.o",
  278. "-march=armv7-a",
  279. -- "-Wl,-shared,-Bsymbolic",
  280. -- "-Wl,--gc-sections",
  281. "-Wl,--fix-cortex-a8",
  282. -- "-Wl,--no-undefined",
  283. "-static-libgcc",
  284. "-no-canonical-prefixes",
  285. "-Wl,--no-undefined",
  286. "-Wl,-z,noexecstack",
  287. "-Wl,-z,relro",
  288. "-Wl,-z,now",
  289. }
  290. links {
  291. "c",
  292. "m",
  293. "android",
  294. "log",
  295. "gnustl_static",
  296. "gcc",
  297. }
  298. buildoptions {
  299. "-std=c++0x",
  300. "-U__STRICT_ANSI__",
  301. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  302. "-fpic",
  303. "--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
  304. "-mthumb",
  305. "-march=armv7-a",
  306. "-mfloat-abi=softfp",
  307. "-mfpu=vfpv3-d16",
  308. }
  309. configuration { "emscripten-experimental" }
  310. targetdir (_buildDir .. "emscripten" .. "/bin")
  311. objdir (_buildDir .. "emscripten" .. "/obj")
  312. libdirs { _libDir .. "lib/emscripten" }
  313. includedirs { "$(EMSCRIPTEN)/system/include" }
  314. buildoptions {
  315. "-pthread",
  316. }
  317. configuration { "nacl or nacl-arm or pnacl" }
  318. includedirs {
  319. "$(NACL_SDK_ROOT)/include",
  320. bxDir .. "include/compat/nacl",
  321. }
  322. configuration { "nacl" }
  323. buildoptions {
  324. "-std=c++0x",
  325. "-U__STRICT_ANSI__",
  326. "-pthread",
  327. "-fno-stack-protector",
  328. "-fdiagnostics-show-option",
  329. "-Wunused-value",
  330. "-fdata-sections",
  331. "-ffunction-sections",
  332. "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
  333. "-msse2",
  334. -- "-fmerge-all-constants",
  335. }
  336. linkoptions {
  337. "-Wl,--gc-sections",
  338. }
  339. configuration { "x32", "nacl" }
  340. targetdir (_buildDir .. "nacl-x86" .. "/bin")
  341. objdir (_buildDir .. "nacl-x86" .. "/obj")
  342. libdirs { _libDir .. "lib/nacl-x86" }
  343. linkoptions { "-melf32_nacl" }
  344. configuration { "x64", "nacl" }
  345. targetdir (_buildDir .. "nacl-x64" .. "/bin")
  346. objdir (_buildDir .. "nacl-x64" .. "/obj")
  347. libdirs { _libDir .. "lib/nacl-x64" }
  348. linkoptions { "-melf64_nacl" }
  349. configuration { "nacl-arm" }
  350. buildoptions {
  351. "-std=c++0x",
  352. "-U__STRICT_ANSI__",
  353. "-fno-stack-protector",
  354. "-fdiagnostics-show-option",
  355. "-Wunused-value",
  356. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  357. "-fdata-sections",
  358. "-ffunction-sections",
  359. }
  360. targetdir (_buildDir .. "nacl-arm" .. "/bin")
  361. objdir (_buildDir .. "nacl-arm" .. "/obj")
  362. libdirs { _libDir .. "lib/nacl-arm" }
  363. configuration { "pnacl" }
  364. buildoptions {
  365. "-std=c++0x",
  366. "-U__STRICT_ANSI__",
  367. "-fno-stack-protector",
  368. "-fdiagnostics-show-option",
  369. "-Wunused-value",
  370. "-fdata-sections",
  371. "-ffunction-sections",
  372. }
  373. targetdir (_buildDir .. "pnacl" .. "/bin")
  374. objdir (_buildDir .. "pnacl" .. "/obj")
  375. libdirs { _libDir .. "lib/pnacl" }
  376. includedirs { "$(PNACL)/sysroot/include" }
  377. configuration { "Xbox360" }
  378. targetdir (_buildDir .. "xbox360" .. "/bin")
  379. objdir (_buildDir .. "xbox360" .. "/obj")
  380. includedirs { bxDir .. "include/compat/msvc" }
  381. libdirs { _libDir .. "lib/xbox360" }
  382. defines {
  383. "NOMINMAX",
  384. "_XBOX",
  385. }
  386. configuration { "osx", "x32" }
  387. targetdir (_buildDir .. "osx32_gcc" .. "/bin")
  388. objdir (_buildDir .. "osx32_gcc" .. "/obj")
  389. libdirs { _libDir .. "lib/osx32_gcc" }
  390. buildoptions {
  391. "-m32",
  392. }
  393. configuration { "osx", "x64" }
  394. targetdir (_buildDir .. "osx64_gcc" .. "/bin")
  395. objdir (_buildDir .. "osx64_gcc" .. "/obj")
  396. libdirs { _libDir .. "lib/osx64_gcc" }
  397. buildoptions {
  398. "-m64",
  399. }
  400. configuration { "osx" }
  401. buildoptions {
  402. "-U__STRICT_ANSI__",
  403. "-Wfatal-errors",
  404. "-Wunused-value",
  405. "-msse2",
  406. }
  407. includedirs { bxDir .. "include/compat/osx" }
  408. configuration { "ios-arm" }
  409. targetdir (_buildDir .. "ios-arm" .. "/bin")
  410. objdir (_buildDir .. "ios-arm" .. "/obj")
  411. libdirs { _libDir .. "lib/ios-arm" }
  412. linkoptions {
  413. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk",
  414. "-march=armv7-a",
  415. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system",
  416. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks",
  417. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/PrivateFrameworks",
  418. }
  419. buildoptions {
  420. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk",
  421. "-mthumb",
  422. "-march=armv7-a",
  423. "-mfloat-abi=softfp",
  424. "-mfpu=neon",
  425. "-U__STRICT_ANSI__",
  426. "-Wfatal-errors",
  427. "-Wunused-value",
  428. }
  429. includedirs { bxDir .. "include/compat/osx" }
  430. configuration { "ios-simulator" }
  431. targetdir (_buildDir .. "ios-simulator" .. "/bin")
  432. objdir (_buildDir .. "ios-simulator" .. "/obj")
  433. libdirs { _libDir .. "lib/ios-simulator" }
  434. linkoptions {
  435. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk",
  436. "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/lib/system",
  437. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks",
  438. "-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/PrivateFrameworks",
  439. }
  440. buildoptions {
  441. "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk",
  442. "-miphoneos-version-min=3.0.0",
  443. "-fobjc-abi-version=2",
  444. "-fobjc-legacy-dispatch",
  445. "-U__STRICT_ANSI__",
  446. "-Wfatal-errors",
  447. "-Wunused-value",
  448. }
  449. includedirs { bxDir .. "include/compat/osx" }
  450. configuration { "qnx-arm" }
  451. targetdir (_buildDir .. "qnx-arm" .. "/bin")
  452. objdir (_buildDir .. "qnx-arm" .. "/obj")
  453. libdirs { _libDir .. "lib/qnx-arm" }
  454. -- includedirs { bxDir .. "include/compat/qnx" }
  455. buildoptions {
  456. "-std=c++0x",
  457. "-U__STRICT_ANSI__",
  458. "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
  459. }
  460. configuration {} -- reset configuration
  461. end
  462. function strip()
  463. configuration { "android*", "Release" }
  464. postbuildcommands {
  465. "@echo Stripping symbols.",
  466. "@$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
  467. }
  468. configuration { "linux", "Release" }
  469. postbuildcommands {
  470. "@echo Stripping symbols.",
  471. "@strip -s \"$(TARGET)\""
  472. }
  473. configuration { "mingw", "Release" }
  474. postbuildcommands {
  475. "@echo Stripping symbols.",
  476. "@$(MINGW)/bin/strip -s \"$(TARGET)\""
  477. }
  478. configuration { "nacl", "Release" }
  479. postbuildcommands {
  480. "@echo Stripping symbols.",
  481. "@$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-strip -s \"$(TARGET)\""
  482. }
  483. configuration { "nacl-arm", "Release" }
  484. postbuildcommands {
  485. "@echo Stripping symbols.",
  486. "@$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-strip -s \"$(TARGET)\""
  487. }
  488. configuration { "pnacl", "Release" }
  489. postbuildcommands {
  490. "@echo Stripping symbols.",
  491. "@$(NACL_SDK_ROOT)/toolchain/win_x86_pnacl/newlib/bin/pnacl-strip -s \"$(TARGET)\""
  492. }
  493. configuration {} -- reset configuration
  494. end