toolchain.lua 16 KB

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