PageRenderTime 36ms CodeModel.GetById 5ms RepoModel.GetById 0ms app.codeStats 0ms

/thirdparty/breakpad/client/windows/build/common.gypi

http://github.com/tomahawk-player/tomahawk
Unknown | 1339 lines | 1288 code | 51 blank | 0 comment | 0 complexity | eb9e29b92f640aaac353c54a5d7d6112 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, GPL-3.0, GPL-2.0
  1. # Copyright (c) 2010, Google Inc.
  2. # All rights reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions are
  6. # met:
  7. #
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above
  11. # copyright notice, this list of conditions and the following disclaimer
  12. # in the documentation and/or other materials provided with the
  13. # distribution.
  14. # * Neither the name of Google Inc. nor the names of its
  15. # contributors may be used to endorse or promote products derived from
  16. # this software without specific prior written permission.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. # IMPORTANT:
  30. # Please don't directly include this file if you are building via gyp_chromium,
  31. # since gyp_chromium is automatically forcing its inclusion.
  32. {
  33. 'variables': {
  34. # .gyp files or targets should set chromium_code to 1 if they build
  35. # Chromium-specific code, as opposed to external code. This variable is
  36. # used to control such things as the set of warnings to enable, and
  37. # whether warnings are treated as errors.
  38. 'chromium_code%': 0,
  39. # Variables expected to be overriden on the GYP command line (-D) or by
  40. # ~/.gyp/include.gypi.
  41. # Putting a variables dict inside another variables dict looks kind of
  42. # weird. This is done so that "branding" and "buildtype" are defined as
  43. # variables within the outer variables dict here. This is necessary
  44. # to get these variables defined for the conditions within this variables
  45. # dict that operate on these variables.
  46. 'variables': {
  47. # Override branding to select the desired branding flavor.
  48. 'branding%': 'Chromium',
  49. # Override buildtype to select the desired build flavor.
  50. # Dev - everyday build for development/testing
  51. # Official - release build (generally implies additional processing)
  52. # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
  53. # conversion is done), some of the things which are now controlled by
  54. # 'branding', such as symbol generation, will need to be refactored based
  55. # on 'buildtype' (i.e. we don't care about saving symbols for non-Official
  56. # builds).
  57. 'buildtype%': 'Dev',
  58. 'variables': {
  59. # Compute the architecture that we're building on.
  60. 'conditions': [
  61. [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
  62. # This handles the Linux platforms we generally deal with. Anything
  63. # else gets passed through, which probably won't work very well; such
  64. # hosts should pass an explicit target_arch to gyp.
  65. 'host_arch%':
  66. '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
  67. }, { # OS!="linux"
  68. 'host_arch%': 'ia32',
  69. }],
  70. ],
  71. # Whether we're building a ChromeOS build. We set the initial
  72. # value at this level of nesting so it's available for the
  73. # toolkit_views test below.
  74. 'chromeos%': '0',
  75. },
  76. # Set default value of toolkit_views on for Windows and Chrome OS.
  77. # We set it at this level of nesting so the value is available for
  78. # other conditionals below.
  79. 'conditions': [
  80. ['OS=="win" or chromeos==1', {
  81. 'toolkit_views%': 1,
  82. }, {
  83. 'toolkit_views%': 0,
  84. }],
  85. ],
  86. 'host_arch%': '<(host_arch)',
  87. # Default architecture we're building for is the architecture we're
  88. # building on.
  89. 'target_arch%': '<(host_arch)',
  90. # We do want to build Chromium with Breakpad support in certain
  91. # situations. I.e. for Chrome bot.
  92. 'linux_chromium_breakpad%': 0,
  93. # And if we want to dump symbols.
  94. 'linux_chromium_dump_symbols%': 0,
  95. # Also see linux_strip_binary below.
  96. # Copy conditionally-set chromeos variable out one scope.
  97. 'chromeos%': '<(chromeos)',
  98. # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
  99. # are built under a chromium full build (1) or a webkit.org chromium
  100. # build (0).
  101. 'inside_chromium_build%': 1,
  102. # Set to 1 to enable fast builds. It disables debug info for fastest
  103. # compilation.
  104. 'fastbuild%': 0,
  105. # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
  106. # libraries on linux x86-64 and arm.
  107. 'linux_fpic%': 0,
  108. # Python version.
  109. 'python_ver%': '2.5',
  110. # Set ARM-v7 compilation flags
  111. 'armv7%': 0,
  112. # Set Neon compilation flags (only meaningful if armv7==1).
  113. 'arm_neon%': 1,
  114. # The system root for cross-compiles. Default: none.
  115. 'sysroot%': '',
  116. # On Linux, we build with sse2 for Chromium builds.
  117. 'disable_sse2%': 0,
  118. },
  119. # Define branding and buildtype on the basis of their settings within the
  120. # variables sub-dict above, unless overridden.
  121. 'branding%': '<(branding)',
  122. 'buildtype%': '<(buildtype)',
  123. 'target_arch%': '<(target_arch)',
  124. 'host_arch%': '<(host_arch)',
  125. 'toolkit_views%': '<(toolkit_views)',
  126. 'chromeos%': '<(chromeos)',
  127. 'inside_chromium_build%': '<(inside_chromium_build)',
  128. 'fastbuild%': '<(fastbuild)',
  129. 'linux_fpic%': '<(linux_fpic)',
  130. 'python_ver%': '<(python_ver)',
  131. 'armv7%': '<(armv7)',
  132. 'arm_neon%': '<(arm_neon)',
  133. 'sysroot%': '<(sysroot)',
  134. 'disable_sse2%': '<(disable_sse2)',
  135. # The release channel that this build targets. This is used to restrict
  136. # channel-specific build options, like which installer packages to create.
  137. # The default is 'all', which does no channel-specific filtering.
  138. 'channel%': 'all',
  139. # Override chromium_mac_pch and set it to 0 to suppress the use of
  140. # precompiled headers on the Mac. Prefix header injection may still be
  141. # used, but prefix headers will not be precompiled. This is useful when
  142. # using distcc to distribute a build to compile slaves that don't
  143. # share the same compiler executable as the system driving the compilation,
  144. # because precompiled headers rely on pointers into a specific compiler
  145. # executable's image. Setting this to 0 is needed to use an experimental
  146. # Linux-Mac cross compiler distcc farm.
  147. 'chromium_mac_pch%': 1,
  148. # Mac OS X SDK and deployment target support.
  149. # The SDK identifies the version of the system headers that will be used,
  150. # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
  151. # "Maximum allowed" refers to the operating system version whose APIs are
  152. # available in the headers.
  153. # The deployment target identifies the minimum system version that the
  154. # built products are expected to function on. It corresponds to the
  155. # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
  156. # To ensure these macros are available, #include <AvailabilityMacros.h>.
  157. # Additional documentation on these macros is available at
  158. # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
  159. # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
  160. # deployment target to 10.5. Other projects, such as O3D, may override
  161. # these defaults.
  162. 'mac_sdk%': '10.5',
  163. 'mac_deployment_target%': '10.5',
  164. # Set to 1 to enable code coverage. In addition to build changes
  165. # (e.g. extra CFLAGS), also creates a new target in the src/chrome
  166. # project file called "coverage".
  167. # Currently ignored on Windows.
  168. 'coverage%': 0,
  169. # Although base/allocator lets you select a heap library via an
  170. # environment variable, the libcmt shim it uses sometimes gets in
  171. # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
  172. # 'win_use_allocator_shim': 0,
  173. # 'win_release_RuntimeLibrary': 2
  174. # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
  175. 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
  176. # To do a shared build on linux we need to be able to choose between type
  177. # static_library and shared_library. We default to doing a static build
  178. # but you can override this with "gyp -Dlibrary=shared_library" or you
  179. # can add the following line (without the #) to ~/.gyp/include.gypi
  180. # {'variables': {'library': 'shared_library'}}
  181. # to compile as shared by default
  182. 'library%': 'static_library',
  183. # Whether usage of OpenMAX is enabled.
  184. 'enable_openmax%': 0,
  185. # TODO(bradnelson): eliminate this when possible.
  186. # To allow local gyp files to prevent release.vsprops from being included.
  187. # Yes(1) means include release.vsprops.
  188. # Once all vsprops settings are migrated into gyp, this can go away.
  189. 'msvs_use_common_release%': 1,
  190. # TODO(bradnelson): eliminate this when possible.
  191. # To allow local gyp files to override additional linker options for msvs.
  192. # Yes(1) means set use the common linker options.
  193. 'msvs_use_common_linker_extras%': 1,
  194. # TODO(sgk): eliminate this if possible.
  195. # It would be nicer to support this via a setting in 'target_defaults'
  196. # in chrome/app/locales/locales.gypi overriding the setting in the
  197. # 'Debug' configuration in the 'target_defaults' dict below,
  198. # but that doesn't work as we'd like.
  199. 'msvs_debug_link_incremental%': '2',
  200. # This is the location of the sandbox binary. Chrome looks for this before
  201. # running the zygote process. If found, and SUID, it will be used to
  202. # sandbox the zygote process and, thus, all renderer processes.
  203. 'linux_sandbox_path%': '',
  204. # Set this to true to enable SELinux support.
  205. 'selinux%': 0,
  206. # Strip the binary after dumping symbols.
  207. 'linux_strip_binary%': 0,
  208. # Enable TCMalloc.
  209. 'linux_use_tcmalloc%': 1,
  210. # Disable TCMalloc's debugallocation.
  211. 'linux_use_debugallocation%': 0,
  212. # Disable TCMalloc's heapchecker.
  213. 'linux_use_heapchecker%': 0,
  214. # Set to 1 to turn on seccomp sandbox by default.
  215. # (Note: this is ignored for official builds.)
  216. 'linux_use_seccomp_sandbox%': 0,
  217. # Set to select the Title Case versions of strings in GRD files.
  218. 'use_titlecase_in_grd_files%': 0,
  219. # Used to disable Native Client at compile time, for platforms where it
  220. # isn't supported
  221. 'disable_nacl%': 0,
  222. # Set Thumb compilation flags.
  223. 'arm_thumb%': 0,
  224. # Set ARM fpu compilation flags (only meaningful if armv7==1 and
  225. # arm_neon==0).
  226. 'arm_fpu%': 'vfpv3',
  227. # Enable new NPDevice API.
  228. 'enable_new_npdevice_api%': 0,
  229. 'conditions': [
  230. ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
  231. # This will set gcc_version to XY if you are running gcc X.Y.*.
  232. # This is used to tweak build flags for gcc 4.4.
  233. 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
  234. # Figure out the python architecture to decide if we build pyauto.
  235. 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
  236. 'conditions': [
  237. ['branding=="Chrome" or linux_chromium_breakpad==1', {
  238. 'linux_breakpad%': 1,
  239. }, {
  240. 'linux_breakpad%': 0,
  241. }],
  242. # All Chrome builds have breakpad symbols, but only process the
  243. # symbols from official builds.
  244. # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
  245. # crash server handle 64-bit symbols.
  246. ['linux_chromium_dump_symbols==1 or '
  247. '(branding=="Chrome" and buildtype=="Official" and '
  248. 'target_arch=="ia32")', {
  249. 'linux_dump_symbols%': 1,
  250. }, {
  251. 'linux_dump_symbols%': 0,
  252. }],
  253. ['toolkit_views==0', {
  254. # GTK wants Title Case strings
  255. 'use_titlecase_in_grd_files%': 1,
  256. }],
  257. ],
  258. }], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
  259. ['OS=="mac"', {
  260. # Mac wants Title Case strings
  261. 'use_titlecase_in_grd_files%': 1,
  262. 'conditions': [
  263. # mac_product_name is set to the name of the .app bundle as it should
  264. # appear on disk. This duplicates data from
  265. # chrome/app/theme/chromium/BRANDING and
  266. # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
  267. # these names into the build system.
  268. ['branding=="Chrome"', {
  269. 'mac_product_name%': 'Google Chrome',
  270. }, { # else: branding!="Chrome"
  271. 'mac_product_name%': 'Chromium',
  272. }],
  273. # Feature variables for enabling Mac Breakpad and Keystone auto-update
  274. # support. Both features are on by default in official builds with
  275. # Chrome branding.
  276. ['branding=="Chrome" and buildtype=="Official"', {
  277. 'mac_breakpad%': 1,
  278. 'mac_keystone%': 1,
  279. }, { # else: branding!="Chrome" or buildtype!="Official"
  280. 'mac_breakpad%': 0,
  281. 'mac_keystone%': 0,
  282. }],
  283. ],
  284. }], # OS=="mac"
  285. # Whether to use multiple cores to compile with visual studio. This is
  286. # optional because it sometimes causes corruption on VS 2005.
  287. # It is on by default on VS 2008 and off on VS 2005.
  288. ['OS=="win"', {
  289. 'conditions': [
  290. ['MSVS_VERSION=="2005"', {
  291. 'msvs_multi_core_compile%': 0,
  292. },{
  293. 'msvs_multi_core_compile%': 1,
  294. }],
  295. # Don't do incremental linking for large modules on 32-bit.
  296. ['MSVS_OS_BITS==32', {
  297. 'msvs_large_module_debug_link_mode%': '1', # No
  298. },{
  299. 'msvs_large_module_debug_link_mode%': '2', # Yes
  300. }],
  301. ],
  302. 'nacl_win64_defines': [
  303. # This flag is used to minimize dependencies when building
  304. # Native Client loader for 64-bit Windows.
  305. 'NACL_WIN64',
  306. ],
  307. }],
  308. # Compute based on OS and target architecture whether the GPU
  309. # plugin / process is supported.
  310. [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
  311. # Enable a variable used elsewhere throughout the GYP files to determine
  312. # whether to compile in the sources for the GPU plugin / process.
  313. 'enable_gpu%': 1,
  314. }, { # GPU plugin not supported
  315. 'enable_gpu%': 0,
  316. }],
  317. # Compute based on OS, target architecture and device whether GLES
  318. # is supported
  319. [ 'OS=="linux" and target_arch=="arm" and chromeos==1', {
  320. # Enable a variable used elsewhere throughout the GYP files to determine
  321. # whether to compile in the sources for the GLES support.
  322. 'enable_gles%': 1,
  323. }, { # GLES not supported
  324. 'enable_gles%': 0,
  325. }],
  326. ],
  327. # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
  328. # so Cocoa is happy (http://crbug.com/20441).
  329. 'locales': [
  330. 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
  331. 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
  332. 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
  333. 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
  334. 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
  335. 'vi', 'zh-CN', 'zh-TW',
  336. ],
  337. },
  338. 'target_defaults': {
  339. 'variables': {
  340. # The condition that operates on chromium_code is in a target_conditions
  341. # section, and will not have access to the default fallback value of
  342. # chromium_code at the top of this file, or to the chromium_code
  343. # variable placed at the root variables scope of .gyp files, because
  344. # those variables are not set at target scope. As a workaround,
  345. # if chromium_code is not set at target scope, define it in target scope
  346. # to contain whatever value it has during early variable expansion.
  347. # That's enough to make it available during target conditional
  348. # processing.
  349. 'chromium_code%': '<(chromium_code)',
  350. # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
  351. 'mac_release_optimization%': '3', # Use -O3 unless overridden
  352. 'mac_debug_optimization%': '0', # Use -O0 unless overridden
  353. # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
  354. 'win_release_Optimization%': '2', # 2 = /Os
  355. 'win_debug_Optimization%': '0', # 0 = /Od
  356. # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
  357. 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
  358. 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
  359. 'release_extra_cflags%': '',
  360. 'debug_extra_cflags%': '',
  361. 'release_valgrind_build%': 0,
  362. },
  363. 'conditions': [
  364. ['branding=="Chrome"', {
  365. 'defines': ['GOOGLE_CHROME_BUILD'],
  366. }, { # else: branding!="Chrome"
  367. 'defines': ['CHROMIUM_BUILD'],
  368. }],
  369. ['toolkit_views==1', {
  370. 'defines': ['TOOLKIT_VIEWS=1'],
  371. }],
  372. ['chromeos==1', {
  373. 'defines': ['OS_CHROMEOS=1'],
  374. }],
  375. ['fastbuild!=0', {
  376. 'conditions': [
  377. # Finally, for Windows, we simply turn on profiling.
  378. ['OS=="win"', {
  379. 'msvs_settings': {
  380. 'VCLinkerTool': {
  381. 'GenerateDebugInformation': 'false',
  382. },
  383. 'VCCLCompilerTool': {
  384. 'DebugInformationFormat': '0',
  385. }
  386. }
  387. }, { # else: OS != "win"
  388. 'cflags': [ '-g1' ],
  389. }],
  390. ], # conditions for fastbuild.
  391. }], # fastbuild!=0
  392. ['selinux==1', {
  393. 'defines': ['CHROMIUM_SELINUX=1'],
  394. }],
  395. ['win_use_allocator_shim==0', {
  396. 'conditions': [
  397. ['OS=="win"', {
  398. 'defines': ['NO_TCMALLOC'],
  399. }],
  400. ],
  401. }],
  402. ['enable_gpu==1', {
  403. 'defines': [
  404. 'ENABLE_GPU=1',
  405. ],
  406. }],
  407. ['enable_gles==1', {
  408. 'defines': [
  409. 'ENABLE_GLES=1',
  410. ],
  411. }],
  412. ['coverage!=0', {
  413. 'conditions': [
  414. ['OS=="mac"', {
  415. 'xcode_settings': {
  416. 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
  417. 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
  418. },
  419. # Add -lgcov for types executable, shared_library, and
  420. # loadable_module; not for static_library.
  421. # This is a delayed conditional.
  422. 'target_conditions': [
  423. ['_type!="static_library"', {
  424. 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
  425. }],
  426. ],
  427. }],
  428. # Linux gyp (into scons) doesn't like target_conditions?
  429. # TODO(???): track down why 'target_conditions' doesn't work
  430. # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
  431. ['OS=="linux"', {
  432. 'cflags': [ '-ftest-coverage',
  433. '-fprofile-arcs' ],
  434. 'link_settings': { 'libraries': [ '-lgcov' ] },
  435. }],
  436. # Finally, for Windows, we simply turn on profiling.
  437. ['OS=="win"', {
  438. 'msvs_settings': {
  439. 'VCLinkerTool': {
  440. 'Profile': 'true',
  441. },
  442. 'VCCLCompilerTool': {
  443. # /Z7, not /Zi, so coverage is happyb
  444. 'DebugInformationFormat': '1',
  445. 'AdditionalOptions': ['/Yd'],
  446. }
  447. }
  448. }], # OS==win
  449. ], # conditions for coverage
  450. }], # coverage!=0
  451. ], # conditions for 'target_defaults'
  452. 'target_conditions': [
  453. ['chromium_code==0', {
  454. 'conditions': [
  455. [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
  456. 'cflags!': [
  457. '-Wall',
  458. '-Wextra',
  459. '-Werror',
  460. ],
  461. }],
  462. [ 'OS=="win"', {
  463. 'defines': [
  464. '_CRT_SECURE_NO_DEPRECATE',
  465. '_CRT_NONSTDC_NO_WARNINGS',
  466. '_CRT_NONSTDC_NO_DEPRECATE',
  467. '_SCL_SECURE_NO_DEPRECATE',
  468. ],
  469. 'msvs_disabled_warnings': [4800],
  470. 'msvs_settings': {
  471. 'VCCLCompilerTool': {
  472. 'WarnAsError': 'false',
  473. 'Detect64BitPortabilityProblems': 'false',
  474. },
  475. },
  476. }],
  477. [ 'OS=="mac"', {
  478. 'xcode_settings': {
  479. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
  480. 'WARNING_CFLAGS!': ['-Wall'],
  481. },
  482. }],
  483. ],
  484. }, {
  485. # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
  486. # C99 macros on Mac and Linux.
  487. 'defines': [
  488. '__STDC_FORMAT_MACROS',
  489. ],
  490. 'conditions': [
  491. ['OS!="win"', {
  492. 'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
  493. ['exclude', '/win/'],
  494. ['exclude', '/win_[^/]*\\.cc$'] ],
  495. }],
  496. ['OS!="mac"', {
  497. 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
  498. ['exclude', '/(cocoa|mac)/'],
  499. ['exclude', '\.mm?$' ] ],
  500. }],
  501. ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
  502. 'sources/': [
  503. ['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.cc$'],
  504. ['exclude', '/gtk/'],
  505. ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
  506. ],
  507. }],
  508. ['OS!="linux"', {
  509. 'sources/': [
  510. ['exclude', '_linux(_unittest)?\\.cc$'],
  511. ['exclude', '/linux/'],
  512. ],
  513. }],
  514. # We use "POSIX" to refer to all non-Windows operating systems.
  515. ['OS=="win"', {
  516. 'sources/': [ ['exclude', '_posix\\.cc$'] ],
  517. }],
  518. # Though Skia is conceptually shared by Linux and Windows,
  519. # the only _skia files in our tree are Linux-specific.
  520. ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
  521. 'sources/': [ ['exclude', '_skia\\.cc$'] ],
  522. }],
  523. ['chromeos!=1', {
  524. 'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
  525. }],
  526. ['toolkit_views==0', {
  527. 'sources/': [ ['exclude', '_views\\.cc$'] ]
  528. }],
  529. ],
  530. }],
  531. ], # target_conditions for 'target_defaults'
  532. 'default_configuration': 'Debug',
  533. 'configurations': {
  534. # VCLinkerTool LinkIncremental values below:
  535. # 0 == default
  536. # 1 == /INCREMENTAL:NO
  537. # 2 == /INCREMENTAL
  538. # Debug links incremental, Release does not.
  539. #
  540. # Abstract base configurations to cover common
  541. # attributes.
  542. #
  543. 'Common_Base': {
  544. 'abstract': 1,
  545. 'msvs_configuration_attributes': {
  546. 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
  547. 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
  548. 'CharacterSet': '1',
  549. },
  550. },
  551. 'x86_Base': {
  552. 'abstract': 1,
  553. 'msvs_settings': {
  554. 'VCLinkerTool': {
  555. 'TargetMachine': '1',
  556. },
  557. },
  558. 'msvs_configuration_platform': 'Win32',
  559. },
  560. 'x64_Base': {
  561. 'abstract': 1,
  562. 'msvs_configuration_platform': 'x64',
  563. 'msvs_settings': {
  564. 'VCLinkerTool': {
  565. 'TargetMachine': '17', # x86 - 64
  566. 'AdditionalLibraryDirectories!':
  567. ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
  568. 'AdditionalLibraryDirectories':
  569. ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
  570. },
  571. 'VCLibrarianTool': {
  572. 'AdditionalLibraryDirectories!':
  573. ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
  574. 'AdditionalLibraryDirectories':
  575. ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
  576. },
  577. },
  578. 'defines': [
  579. # Not sure if tcmalloc works on 64-bit Windows.
  580. 'NO_TCMALLOC',
  581. ],
  582. },
  583. 'Debug_Base': {
  584. 'abstract': 1,
  585. 'xcode_settings': {
  586. 'COPY_PHASE_STRIP': 'NO',
  587. 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
  588. 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
  589. },
  590. 'msvs_settings': {
  591. 'VCCLCompilerTool': {
  592. 'Optimization': '<(win_debug_Optimization)',
  593. 'PreprocessorDefinitions': ['_DEBUG'],
  594. 'BasicRuntimeChecks': '3',
  595. 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
  596. },
  597. 'VCLinkerTool': {
  598. 'LinkIncremental': '<(msvs_debug_link_incremental)',
  599. },
  600. 'VCResourceCompilerTool': {
  601. 'PreprocessorDefinitions': ['_DEBUG'],
  602. },
  603. },
  604. 'conditions': [
  605. ['OS=="linux"', {
  606. 'cflags': [
  607. '<@(debug_extra_cflags)',
  608. ],
  609. }],
  610. ],
  611. },
  612. 'Release_Base': {
  613. 'abstract': 1,
  614. 'defines': [
  615. 'NDEBUG',
  616. ],
  617. 'xcode_settings': {
  618. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  619. 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
  620. 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
  621. },
  622. 'msvs_settings': {
  623. 'VCCLCompilerTool': {
  624. 'Optimization': '<(win_release_Optimization)',
  625. 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
  626. },
  627. 'VCLinkerTool': {
  628. 'LinkIncremental': '1',
  629. },
  630. },
  631. 'conditions': [
  632. ['release_valgrind_build==0', {
  633. 'defines': ['NVALGRIND'],
  634. }],
  635. ['win_use_allocator_shim==0', {
  636. 'defines': ['NO_TCMALLOC'],
  637. }],
  638. ['win_release_RuntimeLibrary==2', {
  639. # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
  640. # VC\include\typeinfo(139) : warning C4275: non dll-interface
  641. # class 'stdext::exception' used as base for dll-interface
  642. # class 'std::bad_cast'
  643. 'msvs_disabled_warnings': [4275],
  644. }],
  645. ['OS=="linux"', {
  646. 'cflags': [
  647. '<@(release_extra_cflags)',
  648. ],
  649. }],
  650. ],
  651. },
  652. 'Purify_Base': {
  653. 'abstract': 1,
  654. 'defines': [
  655. 'PURIFY',
  656. 'NO_TCMALLOC',
  657. ],
  658. 'msvs_settings': {
  659. 'VCCLCompilerTool': {
  660. 'Optimization': '0',
  661. 'RuntimeLibrary': '0',
  662. 'BufferSecurityCheck': 'false',
  663. },
  664. 'VCLinkerTool': {
  665. 'EnableCOMDATFolding': '1',
  666. 'LinkIncremental': '1',
  667. },
  668. },
  669. },
  670. #
  671. # Concrete configurations
  672. #
  673. 'Debug': {
  674. 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
  675. },
  676. 'Release': {
  677. 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
  678. 'conditions': [
  679. ['msvs_use_common_release', {
  680. 'includes': ['release.gypi'],
  681. }],
  682. ]
  683. },
  684. 'conditions': [
  685. [ 'OS=="win"', {
  686. # TODO(bradnelson): add a gyp mechanism to make this more graceful.
  687. 'Purify': {
  688. 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
  689. },
  690. 'Debug_x64': {
  691. 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
  692. },
  693. 'Release_x64': {
  694. 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
  695. },
  696. 'Purify_x64': {
  697. 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
  698. },
  699. }],
  700. ],
  701. },
  702. },
  703. 'conditions': [
  704. ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
  705. 'target_defaults': {
  706. # Enable -Werror by default, but put it in a variable so it can
  707. # be disabled in ~/.gyp/include.gypi on the valgrind builders.
  708. 'variables': {
  709. # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
  710. # issues that slip through the cracks. We could do this just for
  711. # gcc 4.4 but it makes more sense to be consistent on all
  712. # compilers in use. TODO(Craig): turn this off again when
  713. # there is some 4.4 test infrastructure in place and existing
  714. # aliasing issues have been fixed.
  715. 'no_strict_aliasing%': 1,
  716. 'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
  717. ['OS=="freebsd"', {'werror%': '',}],
  718. ['OS=="openbsd"', {'werror%': '',}],
  719. ],
  720. },
  721. 'cflags': [
  722. '<(werror)', # See note above about the werror variable.
  723. '-pthread',
  724. '-fno-exceptions',
  725. '-Wall',
  726. # TODO(evan): turn this back on once all the builds work.
  727. # '-Wextra',
  728. # Don't warn about unused function params. We use those everywhere.
  729. '-Wno-unused-parameter',
  730. # Don't warn about the "struct foo f = {0};" initialization pattern.
  731. '-Wno-missing-field-initializers',
  732. '-D_FILE_OFFSET_BITS=64',
  733. # Don't export any symbols (for example, to plugins we dlopen()).
  734. # Note: this is *required* to make some plugins work.
  735. '-fvisibility=hidden',
  736. ],
  737. 'cflags_cc': [
  738. '-fno-rtti',
  739. '-fno-threadsafe-statics',
  740. # Make inline functions have hidden visiblity by default.
  741. # Surprisingly, not covered by -fvisibility=hidden.
  742. '-fvisibility-inlines-hidden',
  743. ],
  744. 'ldflags': [
  745. '-pthread', '-Wl,-z,noexecstack',
  746. ],
  747. 'scons_variable_settings': {
  748. 'LIBPATH': ['$LIB_DIR'],
  749. # Linking of large files uses lots of RAM, so serialize links
  750. # using the handy flock command from util-linux.
  751. 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
  752. 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
  753. 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
  754. # We have several cases where archives depend on each other in
  755. # a cyclic fashion. Since the GNU linker does only a single
  756. # pass over the archives we surround the libraries with
  757. # --start-group and --end-group (aka -( and -) ). That causes
  758. # ld to loop over the group until no more undefined symbols
  759. # are found. In an ideal world we would only make groups from
  760. # those libraries which we knew to be in cycles. However,
  761. # that's tough with SCons, so we bodge it by making all the
  762. # archives a group by redefining the linking command here.
  763. #
  764. # TODO: investigate whether we still have cycles that
  765. # require --{start,end}-group. There has been a lot of
  766. # refactoring since this was first coded, which might have
  767. # eliminated the circular dependencies.
  768. #
  769. # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
  770. # so that we prefer our own built libraries (e.g. -lpng) to
  771. # system versions of libraries that pkg-config might turn up.
  772. # TODO(sgk): investigate handling this not by re-ordering the
  773. # flags this way, but by adding a hook to use the SCons
  774. # ParseFlags() option on the output from pkg-config.
  775. 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
  776. '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
  777. '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
  778. 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
  779. '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
  780. '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
  781. 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
  782. '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
  783. '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
  784. 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
  785. # -rpath is only used when building with shared libraries.
  786. 'conditions': [
  787. [ 'library=="shared_library"', {
  788. 'RPATH': '$LIB_DIR',
  789. }],
  790. ],
  791. },
  792. 'scons_import_variables': [
  793. 'AS',
  794. 'CC',
  795. 'CXX',
  796. 'LINK',
  797. ],
  798. 'scons_propagate_variables': [
  799. 'AS',
  800. 'CC',
  801. 'CCACHE_DIR',
  802. 'CXX',
  803. 'DISTCC_DIR',
  804. 'DISTCC_HOSTS',
  805. 'HOME',
  806. 'INCLUDE_SERVER_ARGS',
  807. 'INCLUDE_SERVER_PORT',
  808. 'LINK',
  809. 'CHROME_BUILD_TYPE',
  810. 'CHROMIUM_BUILD',
  811. 'OFFICIAL_BUILD',
  812. ],
  813. 'configurations': {
  814. 'Debug_Base': {
  815. 'variables': {
  816. 'debug_optimize%': '0',
  817. },
  818. 'defines': [
  819. '_DEBUG',
  820. ],
  821. 'cflags': [
  822. '-O>(debug_optimize)',
  823. '-g',
  824. # One can use '-gstabs' to enable building the debugging
  825. # information in STABS format for breakpad's dumpsyms.
  826. ],
  827. 'ldflags': [
  828. '-rdynamic', # Allows backtrace to resolve symbols.
  829. ],
  830. },
  831. 'Release_Base': {
  832. 'variables': {
  833. 'release_optimize%': '2',
  834. },
  835. 'cflags': [
  836. '-O>(release_optimize)',
  837. # Don't emit the GCC version ident directives, they just end up
  838. # in the .comment section taking up binary size.
  839. '-fno-ident',
  840. # Put data and code in their own sections, so that unused symbols
  841. # can be removed at link time with --gc-sections.
  842. '-fdata-sections',
  843. '-ffunction-sections',
  844. ],
  845. 'ldflags': [
  846. '-Wl,--gc-sections',
  847. ],
  848. },
  849. },
  850. 'variants': {
  851. 'coverage': {
  852. 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
  853. 'ldflags': ['-fprofile-arcs'],
  854. },
  855. 'profile': {
  856. 'cflags': ['-pg', '-g'],
  857. 'ldflags': ['-pg'],
  858. },
  859. 'symbols': {
  860. 'cflags': ['-g'],
  861. },
  862. },
  863. 'conditions': [
  864. [ 'target_arch=="ia32"', {
  865. 'asflags': [
  866. # Needed so that libs with .s files (e.g. libicudata.a)
  867. # are compatible with the general 32-bit-ness.
  868. '-32',
  869. ],
  870. # All floating-point computations on x87 happens in 80-bit
  871. # precision. Because the C and C++ language standards allow
  872. # the compiler to keep the floating-point values in higher
  873. # precision than what's specified in the source and doing so
  874. # is more efficient than constantly rounding up to 64-bit or
  875. # 32-bit precision as specified in the source, the compiler,
  876. # especially in the optimized mode, tries very hard to keep
  877. # values in x87 floating-point stack (in 80-bit precision)
  878. # as long as possible. This has important side effects, that
  879. # the real value used in computation may change depending on
  880. # how the compiler did the optimization - that is, the value
  881. # kept in 80-bit is different than the value rounded down to
  882. # 64-bit or 32-bit. There are possible compiler options to make
  883. # this behavior consistent (e.g. -ffloat-store would keep all
  884. # floating-values in the memory, thus force them to be rounded
  885. # to its original precision) but they have significant runtime
  886. # performance penalty.
  887. #
  888. # -mfpmath=sse -msse2 makes the compiler use SSE instructions
  889. # which keep floating-point values in SSE registers in its
  890. # native precision (32-bit for single precision, and 64-bit for
  891. # double precision values). This means the floating-point value
  892. # used during computation does not change depending on how the
  893. # compiler optimized the code, since the value is always kept
  894. # in its specified precision.
  895. 'conditions': [
  896. ['branding=="Chromium" and disable_sse2==0', {
  897. 'cflags': [
  898. '-march=pentium4',
  899. '-msse2',
  900. '-mfpmath=sse',
  901. ],
  902. }],
  903. # ChromeOS targets Pinetrail, which is sse3, but most of the
  904. # benefit comes from sse2 so this setting allows ChromeOS
  905. # to build on other CPUs. In the future -march=atom would help
  906. # but requires a newer compiler.
  907. ['chromeos==1 and disable_sse2==0', {
  908. 'cflags': [
  909. '-msse2',
  910. ],
  911. }],
  912. ],
  913. # -mmmx allows mmintrin.h to be used for mmx intrinsics.
  914. # video playback is mmx and sse2 optimized.
  915. 'cflags': [
  916. '-m32',
  917. '-mmmx',
  918. ],
  919. 'ldflags': [
  920. '-m32',
  921. ],
  922. }],
  923. ['target_arch=="arm"', {
  924. 'target_conditions': [
  925. ['_toolset=="target"', {
  926. 'cflags_cc': [
  927. # The codesourcery arm-2009q3 toolchain warns at that the ABI
  928. # has changed whenever it encounters a varargs function. This
  929. # silences those warnings, as they are not helpful and
  930. # clutter legitimate warnings.
  931. '-Wno-abi',
  932. ],
  933. 'conditions': [
  934. ['arm_thumb == 1', {
  935. 'cflags': [
  936. '-mthumb',
  937. # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
  938. # inline assembly that uses condition codes but it's
  939. # suboptimal. Better would be to #ifdef __thumb__ at the
  940. # right place and have a separate thumb path.
  941. '-Wa,-mimplicit-it=thumb',
  942. ]
  943. }],
  944. ['armv7==1', {
  945. 'cflags': [
  946. '-march=armv7-a',
  947. '-mtune=cortex-a8',
  948. '-mfloat-abi=softfp',
  949. ],
  950. 'conditions': [
  951. ['arm_neon==1', {
  952. 'cflags': [ '-mfpu=neon', ],
  953. }, {
  954. 'cflags': [ '-mfpu=<(arm_fpu)', ],
  955. }]
  956. ],
  957. }],
  958. ],
  959. }],
  960. ],
  961. }],
  962. ['linux_fpic==1', {
  963. 'cflags': [
  964. '-fPIC',
  965. ],
  966. }],
  967. ['sysroot!=""', {
  968. 'target_conditions': [
  969. ['_toolset=="target"', {
  970. 'cflags': [
  971. '--sysroot=<(sysroot)',
  972. ],
  973. 'ldflags': [
  974. '--sysroot=<(sysroot)',
  975. ],
  976. }]]
  977. }],
  978. ['no_strict_aliasing==1', {
  979. 'cflags': [
  980. '-fno-strict-aliasing',
  981. ],
  982. }],
  983. ['linux_breakpad==1', {
  984. 'cflags': [ '-gstabs' ],
  985. 'defines': ['USE_LINUX_BREAKPAD'],
  986. }],
  987. ['linux_use_seccomp_sandbox==1 and buildtype!="Official"', {
  988. 'defines': ['USE_SECCOMP_SANDBOX'],
  989. }],
  990. ['library=="shared_library"', {
  991. # When building with shared libraries, remove the visiblity-hiding
  992. # flag.
  993. 'cflags!': [ '-fvisibility=hidden' ],
  994. 'conditions': [
  995. ['target_arch=="x64" or target_arch=="arm"', {
  996. # Shared libraries need -fPIC on x86-64 and arm
  997. 'cflags': ['-fPIC']
  998. }]
  999. ],
  1000. }],
  1001. ['linux_use_heapchecker==1', {
  1002. 'variables': {'linux_use_tcmalloc%': 1},
  1003. }],
  1004. ['linux_use_tcmalloc==0', {
  1005. 'defines': ['NO_TCMALLOC'],
  1006. }],
  1007. ['linux_use_heapchecker==0', {
  1008. 'defines': ['NO_HEAPCHECKER'],
  1009. }],
  1010. ],
  1011. },
  1012. }],
  1013. # FreeBSD-specific options; note that most FreeBSD options are set above,
  1014. # with Linux.
  1015. ['OS=="freebsd"', {
  1016. 'target_defaults': {
  1017. 'ldflags': [
  1018. '-Wl,--no-keep-memory',
  1019. ],
  1020. },
  1021. }],
  1022. ['OS=="solaris"', {
  1023. 'cflags!': ['-fvisibility=hidden'],
  1024. 'cflags_cc!': ['-fvisibility-inlines-hidden'],
  1025. }],
  1026. ['OS=="mac"', {
  1027. 'target_defaults': {
  1028. 'variables': {
  1029. # This should be 'mac_real_dsym%', but there seems to be a bug
  1030. # with % in variables that are intended to be set to different
  1031. # values in different targets, like this one.
  1032. 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
  1033. },
  1034. 'mac_bundle': 0,
  1035. 'xcode_settings': {
  1036. 'ALWAYS_SEARCH_USER_PATHS': 'NO',
  1037. 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
  1038. 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
  1039. 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
  1040. # (Equivalent to -fPIC)
  1041. 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
  1042. 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
  1043. 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
  1044. # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
  1045. 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
  1046. 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
  1047. 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
  1048. 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
  1049. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
  1050. 'GCC_VERSION': '4.2',
  1051. 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
  1052. # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
  1053. 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
  1054. 'PREBINDING': 'NO', # No -Wl,-prebind
  1055. 'USE_HEADERMAP': 'NO',
  1056. 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
  1057. 'conditions': [
  1058. ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
  1059. {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
  1060. ],
  1061. ],
  1062. },
  1063. 'target_conditions': [
  1064. ['_type!="static_library"', {
  1065. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
  1066. }],
  1067. ['_mac_bundle', {
  1068. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
  1069. }],
  1070. ['_type=="executable" or _type=="shared_library"', {
  1071. 'target_conditions': [
  1072. ['mac_real_dsym == 1', {
  1073. # To get a real .dSYM bundle produced by dsymutil, set the
  1074. # debug information format to dwarf-with-dsym. Since
  1075. # strip_from_xcode will not be used, set Xcode to do the
  1076. # stripping as well.
  1077. 'configurations': {
  1078. 'Release_Base': {
  1079. 'xcode_settings': {
  1080. 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
  1081. 'DEPLOYMENT_POSTPROCESSING': 'YES',
  1082. 'STRIP_INSTALLED_PRODUCT': 'YES',
  1083. 'target_conditions': [
  1084. ['_type=="shared_library"', {
  1085. # The Xcode default is to strip debugging symbols
  1086. # only (-S). Local symbols should be stripped as
  1087. # well, which will be handled by -x. Xcode will
  1088. # continue to insert -S when stripping even when
  1089. # additional flags are added with STRIPFLAGS.
  1090. 'STRIPFLAGS': '-x',
  1091. }], # _type=="shared_library"
  1092. ], # target_conditions
  1093. }, # xcode_settings
  1094. }, # configuration "Release"
  1095. }, # configurations
  1096. }, { # mac_real_dsym != 1
  1097. # To get a fast fake .dSYM bundle, use a post-build step to
  1098. # produce the .dSYM and strip the executable. strip_from_xcode
  1099. # only operates in the Release configuration.
  1100. 'postbuilds': [
  1101. {
  1102. 'variables': {
  1103. # Define strip_from_xcode in a variable ending in _path
  1104. # so that gyp understands it's a path and performs proper
  1105. # relativization during dict merging.
  1106. 'strip_from_xcode_path': 'mac/strip_from_xcode',
  1107. },
  1108. 'postbuild_name': 'Strip If Needed',
  1109. 'action': ['<(strip_from_xcode_path)'],
  1110. },
  1111. ], # postbuilds
  1112. }], # mac_real_dsym
  1113. ], # target_conditions
  1114. }], # _type=="executable" or _type=="shared_library"
  1115. ], # target_conditions
  1116. }, # target_defaults
  1117. }], # OS=="mac"
  1118. ['OS=="win"', {
  1119. 'target_defaults': {
  1120. 'defines': [
  1121. '_WIN32_WINNT=0x0600',
  1122. 'WINVER=0x0600',
  1123. 'WIN32',
  1124. '_WINDOWS',
  1125. '_HAS_EXCEPTIONS=0',
  1126. 'NOMINMAX',
  1127. '_CRT_RAND_S',
  1128. 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
  1129. 'WIN32_LEAN_AND_MEAN',
  1130. '_SECURE_ATL',
  1131. '_HAS_TR1=0',
  1132. ],
  1133. 'msvs_system_include_dirs': [
  1134. '<(DEPTH)/third_party/platformsdk_win7/files/Include',
  1135. '$(VSInstallDir)/VC/atlmfc/include',
  1136. ],
  1137. 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
  1138. 'msvs_disabled_warnings': [4396, 4503, 4819],
  1139. 'msvs_settings': {
  1140. 'VCCLCompilerTool': {
  1141. 'MinimalRebuild': 'false',
  1142. 'ExceptionHandling': '0',
  1143. 'BufferSecurityCheck': 'true',
  1144. 'EnableFunctionLevelLinking': 'true',
  1145. 'RuntimeTypeInfo': 'false',
  1146. 'WarningLevel': '3',
  1147. 'WarnAsError': 'true',
  1148. 'DebugInformationFormat': '3',
  1149. 'conditions': [
  1150. [ 'msvs_multi_core_compile', {
  1151. 'AdditionalOptions': ['/MP'],
  1152. }],
  1153. ],
  1154. },
  1155. 'VCLibrarianTool': {
  1156. 'AdditionalOptions': ['/ignore:4221'],
  1157. 'AdditionalLibraryDirectories':
  1158. ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
  1159. },
  1160. 'VCLinkerTool': {
  1161. 'AdditionalDependencies': [
  1162. 'wininet.lib',
  1163. 'version.lib',
  1164. 'msimg32.lib',
  1165. 'ws2_32.lib',
  1166. 'usp10.lib',
  1167. 'psapi.lib',
  1168. 'dbghelp.lib',
  1169. ],
  1170. 'AdditionalLibraryDirectories':
  1171. ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
  1172. 'GenerateDebugInformation': 'true',
  1173. 'MapFileName': '$(OutDir)\\$(TargetName).map',
  1174. 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
  1175. 'FixedBaseAddress': '1',
  1176. # SubSystem values:
  1177. # 0 == not set
  1178. # 1 == /SUBSYSTEM:CONSOLE
  1179. # 2 == /SUBSYSTEM:WINDOWS
  1180. # Most of the executables we'll ever create are tests
  1181. # and utilities with console output.
  1182. 'SubSystem': '1',
  1183. },
  1184. 'VCMIDLTool': {
  1185. 'GenerateStublessProxies': 'true',
  1186. 'TypeLibraryName': '$(InputName).tlb',
  1187. 'OutputDirectory': '$(IntDir)',
  1188. 'HeaderFileName': '$(InputName).h',
  1189. 'DLLDataFileName': 'dlldata.c',
  1190. 'InterfaceIdentifierFileName': '$(InputName)_i.c',
  1191. 'ProxyFileName': '$(InputName)_p.c',
  1192. },
  1193. 'VCResourceCompilerTool': {
  1194. 'Culture' : '1033',
  1195. 'AdditionalIncludeDirectories': ['<(DEPTH)'],
  1196. },
  1197. },
  1198. },
  1199. }],
  1200. ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
  1201. 'target_defaults': {
  1202. 'defines': [
  1203. 'DISABLE_NACL',
  1204. ],
  1205. },
  1206. }],
  1207. ['OS=="win" and msvs_use_common_linker_extras', {
  1208. 'target_defaults': {
  1209. 'msvs_settings': {
  1210. 'VCLinkerTool': {
  1211. 'DelayLoadDLLs': [
  1212. 'dbghelp.dll',
  1213. 'dwmapi.dll',
  1214. 'uxtheme.dll',
  1215. ],
  1216. },
  1217. },
  1218. 'configurations': {
  1219. 'x86_Base': {
  1220. 'msvs_settings': {
  1221. 'VCLinkerTool': {
  1222. 'AdditionalOptions': [
  1223. '/safeseh',
  1224. '/dynamicbase',
  1225. '/ignore:4199',
  1226. '/ignore:4221',
  1227. '/nxcompat',
  1228. ],
  1229. },
  1230. },
  1231. },
  1232. 'x64_Base': {
  1233. 'msvs_settings': {
  1234. 'VCLinkerTool': {
  1235. 'AdditionalOptions': [
  1236. # safeseh is not compatible with x64
  1237. '/dynamicbase',
  1238. '/ignore:4199',
  1239. '/ignore:4221',
  1240. '/nxcompat',
  1241. ],
  1242. },
  1243. },
  1244. },
  1245. },
  1246. },
  1247. }],
  1248. ['enable_new_npdevice_api==1', {
  1249. 'target_defaults': {
  1250. 'defines': [
  1251. 'ENABLE_NEW_NPDEVICE_API',
  1252. ],
  1253. },
  1254. }],
  1255. ],
  1256. 'scons_settings': {
  1257. 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
  1258. 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
  1259. },
  1260. 'xcode_settings': {
  1261. # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
  1262. # This block adds *project-wide* configuration settings to each project
  1263. # file. It's almost always wrong to put things here. Specify your
  1264. # custom xcode_settings in target_defaults to add them to targets instead.
  1265. # In an Xcode Project Info window, the "Base SDK for All Configurations"
  1266. # setting sets the SDK on a project-wide basis. In order to get the
  1267. # configured SDK to show properly in the Xcode UI, SDKROOT must be set
  1268. # here at the project level.
  1269. 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
  1270. # The Xcode generator will look for an xcode_settings section at the root
  1271. # of each dict and use it to apply settings on a file-wide basis. Most
  1272. # settings should not be here, they should be in target-specific
  1273. # xcode_settings sections, or better yet, should use non-Xcode-specific
  1274. # settings in target dicts. SYMROOT is a special case, because many other
  1275. # Xcode variables depend on it, including variables such as
  1276. # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
  1277. # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
  1278. # files to appear (when present) in the UI as actual files and not red
  1279. # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
  1280. # and therefore SYMROOT, needs to be set at the project level.
  1281. 'SYMROOT': '<(DEPTH)/xcodebuild',
  1282. },
  1283. }
  1284. # Local Variables:
  1285. # tab-width:2
  1286. # indent-tabs-mode:nil
  1287. # End:
  1288. # vim: set expandtab tabstop=2 shiftwidth=2: