1 # Copyright 2010 Google Inc. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer
11 # in the documentation and/or other materials provided with the
13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 # Please don't directly include this file if you are building via gyp_chromium,
31 # since gyp_chromium is automatically forcing its inclusion.
34 # Variables expected to be overriden on the GYP command line (-D) or by
35 # ~/.gyp/include.gypi.
37 # Putting a variables dict inside another variables dict looks kind of
38 # weird. This is necessary to get these variables defined for the conditions
39 # within this variables dict that operate on these variables.
42 # Compute the architecture that we're building on.
44 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
45 # This handles the Linux platforms we generally deal with. Anything
46 # else gets passed through, which probably won't work very well; such
47 # hosts should pass an explicit target_arch to gyp.
49 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
56 'host_arch%': '<(host_arch)',
58 # Default architecture we're building for is the architecture we're
60 'target_arch%': '<(host_arch)',
62 # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
63 # are built under a chromium full build (1) or a webkit.org chromium
65 'inside_chromium_build%': 1,
67 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
68 # libraries on linux x86-64 and arm.
74 # Determine ARM compilation flags.
77 # Set Neon compilation flags (only meaningful if arm_version==7).
80 # The system root for cross-compiles. Default: none.
83 # On Linux, we build with sse2 for Chromium builds.
87 'target_arch%': '<(target_arch)',
88 'host_arch%': '<(host_arch)',
89 'inside_chromium_build%': '<(inside_chromium_build)',
90 'linux_fpic%': '<(linux_fpic)',
91 'python_ver%': '<(python_ver)',
92 'arm_version%': '<(arm_version)',
93 'arm_neon%': '<(arm_neon)',
94 'sysroot%': '<(sysroot)',
95 'disable_sse2%': '<(disable_sse2)',
97 # The release channel that this build targets. This is used to restrict
98 # channel-specific build options, like which installer packages to create.
99 # The default is 'all', which does no channel-specific filtering.
102 # Override chromium_mac_pch and set it to 0 to suppress the use of
103 # precompiled headers on the Mac. Prefix header injection may still be
104 # used, but prefix headers will not be precompiled. This is useful when
105 # using distcc to distribute a build to compile slaves that don't
106 # share the same compiler executable as the system driving the compilation,
107 # because precompiled headers rely on pointers into a specific compiler
108 # executable's image. Setting this to 0 is needed to use an experimental
109 # Linux-Mac cross compiler distcc farm.
110 'chromium_mac_pch%': 1,
112 # Mac OS X SDK and deployment target support.
113 # The SDK identifies the version of the system headers that will be used,
114 # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
115 # "Maximum allowed" refers to the operating system version whose APIs are
116 # available in the headers.
117 # The deployment target identifies the minimum system version that the
118 # built products are expected to function on. It corresponds to the
119 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
120 # To ensure these macros are available, #include <AvailabilityMacros.h>.
121 # Additional documentation on these macros is available at
122 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
123 # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
124 # deployment target to 10.5. Other projects, such as O3D, may override
127 'mac_deployment_target%': '10.5',
129 # Set to 1 to enable code coverage. In addition to build changes
130 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
131 # project file called "coverage".
132 # Currently ignored on Windows.
135 # Although base/allocator lets you select a heap library via an
136 # environment variable, the libcmt shim it uses sometimes gets in
137 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
138 # 'win_use_allocator_shim': 0,
139 # 'win_release_RuntimeLibrary': 2
140 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
141 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
143 # Whether usage of OpenMAX is enabled.
144 'enable_openmax%': 0,
146 # TODO(bradnelson): eliminate this when possible.
147 # To allow local gyp files to prevent release.vsprops from being included.
148 # Yes(1) means include release.vsprops.
149 # Once all vsprops settings are migrated into gyp, this can go away.
150 'msvs_use_common_release%': 1,
152 # TODO(bradnelson): eliminate this when possible.
153 # To allow local gyp files to override additional linker options for msvs.
154 # Yes(1) means set use the common linker options.
155 'msvs_use_common_linker_extras%': 1,
157 # TODO(sgk): eliminate this if possible.
158 # It would be nicer to support this via a setting in 'target_defaults'
159 # in chrome/app/locales/locales.gypi overriding the setting in the
160 # 'Debug' configuration in the 'target_defaults' dict below,
161 # but that doesn't work as we'd like.
162 'msvs_debug_link_incremental%': '2',
164 # This is the location of the sandbox binary. Chrome looks for this before
165 # running the zygote process. If found, and SUID, it will be used to
166 # sandbox the zygote process and, thus, all renderer processes.
167 'linux_sandbox_path%': '',
169 # Set this to true to enable SELinux support.
172 # Strip the binary after dumping symbols.
173 'linux_strip_binary%': 0,
176 'linux_use_tcmalloc%': 1,
178 # Disable TCMalloc's debugallocation.
179 'linux_use_debugallocation%': 0,
181 # Disable TCMalloc's heapchecker.
182 'linux_use_heapchecker%': 0,
184 # Set to 1 to turn on seccomp sandbox by default.
185 # (Note: this is ignored for official builds.)
186 'linux_use_seccomp_sandbox%': 0,
188 # Set to select the Title Case versions of strings in GRD files.
189 'use_titlecase_in_grd_files%': 0,
191 # Used to disable Native Client at compile time, for platforms where it
195 # Set Thumb compilation flags.
198 # Set ARM fpu compilation flags (only meaningful if arm_version==7 and
202 # Enable new NPDevice API.
203 'enable_new_npdevice_api%': 0,
206 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
207 # This will set gcc_version to XY if you are running gcc X.Y.*.
208 # This is used to tweak build flags for gcc 4.4.
209 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
210 # Figure out the python architecture to decide if we build pyauto.
211 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
212 'linux_breakpad%': 1,
213 'linux_dump_symbols%': 1,
214 }], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
216 # Mac wants Title Case strings
217 'use_titlecase_in_grd_files%': 1,
221 # Whether to use multiple cores to compile with visual studio. This is
222 # optional because it sometimes causes corruption on VS 2005.
223 # It is on by default on VS 2008 and off on VS 2005.
226 ['MSVS_VERSION=="2005"', {
227 'msvs_multi_core_compile%': 0,
229 'msvs_multi_core_compile%': 1,
231 # Don't do incremental linking for large modules on 32-bit.
232 ['MSVS_OS_BITS==32', {
233 'msvs_large_module_debug_link_mode%': '1', # No
235 'msvs_large_module_debug_link_mode%': '2', # Yes
238 'nacl_win64_defines': [
239 # This flag is used to minimize dependencies when building
240 # Native Client loader for 64-bit Windows.
244 # Compute based on OS and target architecture whether the GPU
245 # plugin / process is supported.
246 [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
247 # Enable a variable used elsewhere throughout the GYP files to determine
248 # whether to compile in the sources for the GPU plugin / process.
250 }, { # GPU plugin not supported
253 # Compute based on OS, target architecture and device whether GLES
255 [ 'OS=="linux" and target_arch=="arm"', {
256 # Enable a variable used elsewhere throughout the GYP files to determine
257 # whether to compile in the sources for the GLES support.
259 }, { # GLES not supported
264 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
265 # so Cocoa is happy (http://crbug.com/20441).
267 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
268 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
269 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
270 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
271 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
272 'vi', 'zh-CN', 'zh-TW',
277 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
278 'mac_release_optimization%': '3', # Use -O3 unless overridden
279 'mac_debug_optimization%': '0', # Use -O0 unless overridden
280 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
281 'win_release_Optimization%': '2', # 2 = /Os
282 'win_debug_Optimization%': '0', # 0 = /Od
283 # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
284 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
285 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
287 'release_extra_cflags%': '',
288 'debug_extra_cflags%': '',
289 'release_valgrind_build%': 0,
293 'defines': ['CHROMIUM_SELINUX=1'],
295 ['win_use_allocator_shim==0', {
298 'defines': ['NO_TCMALLOC'],
316 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
317 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
319 # Add -lgcov for types executable, shared_library, and
320 # loadable_module; not for static_library.
321 # This is a delayed conditional.
322 'target_conditions': [
323 ['_type!="static_library"', {
324 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
328 # Linux gyp (into scons) doesn't like target_conditions?
329 # TODO(???): track down why 'target_conditions' doesn't work
330 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
332 'cflags': [ '-ftest-coverage',
334 'link_settings': { 'libraries': [ '-lgcov' ] },
336 # Finally, for Windows, we simply turn on profiling.
342 'VCCLCompilerTool': {
343 # /Z7, not /Zi, so coverage is happyb
344 'DebugInformationFormat': '1',
345 'AdditionalOptions': ['/Yd'],
349 ], # conditions for coverage
351 ], # conditions for 'target_defaults'
352 'target_conditions': [
353 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
362 '_CRT_SECURE_NO_DEPRECATE',
363 '_CRT_NONSTDC_NO_WARNINGS',
364 '_CRT_NONSTDC_NO_DEPRECATE',
366 'msvs_disabled_warnings': [4800],
368 'VCCLCompilerTool': {
369 'WarnAsError': 'true',
370 'Detect64BitPortabilityProblems': 'false',
376 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
377 'WARNING_CFLAGS!': ['-Wall'],
380 ], # target_conditions for 'target_defaults'
381 'default_configuration': 'Debug',
383 # VCLinkerTool LinkIncremental values below:
385 # 1 == /INCREMENTAL:NO
387 # Debug links incremental, Release does not.
389 # Abstract base configurations to cover common
394 'msvs_configuration_attributes': {
395 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
396 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
404 'TargetMachine': '1',
407 'msvs_configuration_platform': 'Win32',
411 'msvs_configuration_platform': 'x64',
414 'TargetMachine': '17', # x86 - 64
415 'AdditionalLibraryDirectories!':
416 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
417 'AdditionalLibraryDirectories':
418 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
421 'AdditionalLibraryDirectories!':
422 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
423 'AdditionalLibraryDirectories':
424 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
428 # Not sure if tcmalloc works on 64-bit Windows.
435 'COPY_PHASE_STRIP': 'NO',
436 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
437 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
440 'VCCLCompilerTool': {
441 'Optimization': '<(win_debug_Optimization)',
442 'PreprocessorDefinitions': ['_DEBUG'],
443 'BasicRuntimeChecks': '3',
444 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
447 'LinkIncremental': '<(msvs_debug_link_incremental)',
449 'VCResourceCompilerTool': {
450 'PreprocessorDefinitions': ['_DEBUG'],
456 '<@(debug_extra_cflags)',
467 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
468 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
469 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
472 'VCCLCompilerTool': {
473 'Optimization': '<(win_release_Optimization)',
474 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
477 'LinkIncremental': '1',
481 ['release_valgrind_build==0', {
482 'defines': ['NVALGRIND'],
484 ['win_use_allocator_shim==0', {
485 'defines': ['NO_TCMALLOC'],
487 ['win_release_RuntimeLibrary==2', {
488 # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
489 # VC\include\typeinfo(139) : warning C4275: non dll-interface
490 # class 'stdext::exception' used as base for dll-interface
491 # class 'std::bad_cast'
492 'msvs_disabled_warnings': [4275],
496 '<@(release_extra_cflags)',
508 'VCCLCompilerTool': {
510 'RuntimeLibrary': '0',
511 'BufferSecurityCheck': 'false',
514 'EnableCOMDATFolding': '1',
515 'LinkIncremental': '1',
520 # Concrete configurations
523 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
526 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
528 ['msvs_use_common_release', {
529 'defines': ['OFFICIAL_BUILD'],
531 'VCCLCompilerTool': {
533 'StringPooling': 'true',
534 'OmitFramePointers': 'true',
535 'InlineFunctionExpansion': '2',
536 'EnableIntrinsicFunctions': 'true',
537 'FavorSizeOrSpeed': '2',
538 'OmitFramePointers': 'true',
539 'EnableFiberSafeOptimizations': 'true',
540 'WholeProgramOptimization': 'true',
543 'AdditionalOptions': ['/ltcg', '/expectedoutputsize:120000000'],
546 'LinkIncremental': '1',
547 'OptimizeReferences': '2',
548 'EnableCOMDATFolding': '2',
549 'OptimizeForWindows98': '1',
550 'LinkTimeCodeGeneration': '1',
558 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
560 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
563 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
566 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
569 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
576 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
578 # Enable -Werror by default, but put it in a variable so it can
579 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
581 # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
582 # issues that slip through the cracks. We could do this just for
583 # gcc 4.4 but it makes more sense to be consistent on all
584 # compilers in use. TODO(Craig): turn this off again when
585 # there is some 4.4 test infrastructure in place and existing
586 # aliasing issues have been fixed.
587 'no_strict_aliasing%': 1,
588 'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
589 ['OS=="freebsd"', {'werror%': '',}],
590 ['OS=="openbsd"', {'werror%': '',}],
594 '<(werror)', # See note above about the werror variable.
598 # TODO(evan): turn this back on once all the builds work.
600 # Don't warn about unused function params. We use those everywhere.
601 '-Wno-unused-parameter',
602 # Don't warn about the "struct foo f = {0};" initialization pattern.
603 '-Wno-missing-field-initializers',
604 '-D_FILE_OFFSET_BITS=64',
605 # Don't export any symbols (for example, to plugins we dlopen()).
606 # Note: this is *required* to make some plugins work.
607 '-fvisibility=hidden',
611 '-fno-threadsafe-statics',
612 # Make inline functions have hidden visiblity by default.
613 # Surprisingly, not covered by -fvisibility=hidden.
614 '-fvisibility-inlines-hidden',
617 '-pthread', '-Wl,-z,noexecstack',
619 'scons_variable_settings': {
620 'LIBPATH': ['$LIB_DIR'],
621 # Linking of large files uses lots of RAM, so serialize links
622 # using the handy flock command from util-linux.
623 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
624 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
625 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
627 # We have several cases where archives depend on each other in
628 # a cyclic fashion. Since the GNU linker does only a single
629 # pass over the archives we surround the libraries with
630 # --start-group and --end-group (aka -( and -) ). That causes
631 # ld to loop over the group until no more undefined symbols
632 # are found. In an ideal world we would only make groups from
633 # those libraries which we knew to be in cycles. However,
634 # that's tough with SCons, so we bodge it by making all the
635 # archives a group by redefining the linking command here.
637 # TODO: investigate whether we still have cycles that
638 # require --{start,end}-group. There has been a lot of
639 # refactoring since this was first coded, which might have
640 # eliminated the circular dependencies.
642 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
643 # so that we prefer our own built libraries (e.g. -lpng) to
644 # system versions of libraries that pkg-config might turn up.
645 # TODO(sgk): investigate handling this not by re-ordering the
646 # flags this way, but by adding a hook to use the SCons
647 # ParseFlags() option on the output from pkg-config.
648 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
649 '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
650 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
651 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
652 '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
653 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
654 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
655 '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
656 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
657 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
658 # -rpath is only used when building with shared libraries.
660 [ 'component=="shared_library"', {
665 'scons_import_variables': [
671 'scons_propagate_variables': [
679 'INCLUDE_SERVER_ARGS',
680 'INCLUDE_SERVER_PORT',
689 'debug_optimize%': '0',
695 '-O>(debug_optimize)',
697 # One can use '-gstabs' to enable building the debugging
698 # information in STABS format for breakpad's dumpsyms.
701 '-rdynamic', # Allows backtrace to resolve symbols.
706 'release_optimize%': '2',
709 '-O>(release_optimize)',
710 # Don't emit the GCC version ident directives, they just end up
711 # in the .comment section taking up binary size.
713 # Put data and code in their own sections, so that unused symbols
714 # can be removed at link time with --gc-sections.
716 '-ffunction-sections',
725 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
726 'ldflags': ['-fprofile-arcs'],
729 'cflags': ['-pg', '-g'],
737 [ 'target_arch=="ia32"', {
739 # Needed so that libs with .s files (e.g. libicudata.a)
740 # are compatible with the general 32-bit-ness.
743 # All floating-point computations on x87 happens in 80-bit
744 # precision. Because the C and C++ language standards allow
745 # the compiler to keep the floating-point values in higher
746 # precision than what's specified in the source and doing so
747 # is more efficient than constantly rounding up to 64-bit or
748 # 32-bit precision as specified in the source, the compiler,
749 # especially in the optimized mode, tries very hard to keep
750 # values in x87 floating-point stack (in 80-bit precision)
751 # as long as possible. This has important side effects, that
752 # the real value used in computation may change depending on
753 # how the compiler did the optimization - that is, the value
754 # kept in 80-bit is different than the value rounded down to
755 # 64-bit or 32-bit. There are possible compiler options to make
756 # this behavior consistent (e.g. -ffloat-store would keep all
757 # floating-values in the memory, thus force them to be rounded
758 # to its original precision) but they have significant runtime
759 # performance penalty.
761 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
762 # which keep floating-point values in SSE registers in its
763 # native precision (32-bit for single precision, and 64-bit for
764 # double precision values). This means the floating-point value
765 # used during computation does not change depending on how the
766 # compiler optimized the code, since the value is always kept
767 # in its specified precision.
769 ['disable_sse2==0', {
777 # -mmmx allows mmintrin.h to be used for mmx intrinsics.
778 # video playback is mmx and sse2 optimized.
787 ['target_arch=="arm"', {
788 'target_conditions': [
789 ['_toolset=="target"', {
791 # The codesourcery arm-2009q3 toolchain warns at that the ABI
792 # has changed whenever it encounters a varargs function. This
793 # silences those warnings, as they are not helpful and
794 # clutter legitimate warnings.
801 # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
802 # inline assembly that uses condition codes but it's
803 # suboptimal. Better would be to #ifdef __thumb__ at the
804 # right place and have a separate thumb path.
805 '-Wa,-mimplicit-it=thumb',
812 '-mfloat-abi=softfp',
816 'cflags': [ '-mfpu=neon', ],
818 'cflags': [ '-mfpu=<(arm_fpu)', ],
832 'target_conditions': [
833 ['_toolset=="target"', {
835 '--sysroot=<(sysroot)',
838 '--sysroot=<(sysroot)',
842 ['no_strict_aliasing==1', {
844 '-fno-strict-aliasing',
847 ['linux_breakpad==1', {
848 'cflags': [ '-gstabs' ],
849 'defines': ['USE_LINUX_BREAKPAD'],
851 ['library=="shared_library"', {
852 # When building with shared libraries, remove the visiblity-hiding
854 'cflags!': [ '-fvisibility=hidden' ],
856 ['target_arch=="x64" or target_arch=="arm"', {
857 # Shared libraries need -fPIC on x86-64 and arm
862 ['linux_use_heapchecker==1', {
863 'variables': {'linux_use_tcmalloc%': 1},
865 ['linux_use_tcmalloc==0', {
866 'defines': ['NO_TCMALLOC'],
868 ['linux_use_heapchecker==0', {
869 'defines': ['NO_HEAPCHECKER'],
874 # FreeBSD-specific options; note that most FreeBSD options are set above,
879 '-Wl,--no-keep-memory',
884 'cflags!': ['-fvisibility=hidden'],
885 'cflags_cc!': ['-fvisibility-inlines-hidden'],
890 # This should be 'mac_real_dsym%', but there seems to be a bug
891 # with % in variables that are intended to be set to different
892 # values in different targets, like this one.
893 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
897 'ALWAYS_SEARCH_USER_PATHS': 'NO',
898 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
899 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
900 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
901 # (Equivalent to -fPIC)
902 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
903 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
904 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
905 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
906 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
907 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
908 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
909 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
910 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
911 'GCC_VERSION': '4.2',
912 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
913 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
914 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
915 'PREBINDING': 'NO', # No -Wl,-prebind
916 'USE_HEADERMAP': 'NO',
917 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
919 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
920 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
924 'target_conditions': [
925 ['_type!="static_library"', {
926 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
929 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
931 ['_type=="executable" or _type=="shared_library"', {
932 'target_conditions': [
933 ['mac_real_dsym == 1', {
934 # To get a real .dSYM bundle produced by dsymutil, set the
935 # debug information format to dwarf-with-dsym. Since
936 # strip_from_xcode will not be used, set Xcode to do the
941 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
942 'DEPLOYMENT_POSTPROCESSING': 'YES',
943 'STRIP_INSTALLED_PRODUCT': 'YES',
944 'target_conditions': [
945 ['_type=="shared_library"', {
946 # The Xcode default is to strip debugging symbols
947 # only (-S). Local symbols should be stripped as
948 # well, which will be handled by -x. Xcode will
949 # continue to insert -S when stripping even when
950 # additional flags are added with STRIPFLAGS.
952 }], # _type=="shared_library"
953 ], # target_conditions
955 }, # configuration "Release"
957 }, { # mac_real_dsym != 1
958 # To get a fast fake .dSYM bundle, use a post-build step to
959 # produce the .dSYM and strip the executable. strip_from_xcode
960 # only operates in the Release configuration.
964 # Define strip_from_xcode in a variable ending in _path
965 # so that gyp understands it's a path and performs proper
966 # relativization during dict merging.
967 'strip_from_xcode_path': 'mac/strip_from_xcode',
969 'postbuild_name': 'Strip If Needed',
970 'action': ['<(strip_from_xcode_path)'],
974 ], # target_conditions
975 }], # _type=="executable" or _type=="shared_library"
976 ], # target_conditions
982 '_WIN32_WINNT=0x0600',
989 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
990 'WIN32_LEAN_AND_MEAN',
994 'msvs_system_include_dirs': [
995 '<(DEPTH)/third_party/platformsdk_win7/files/Include',
996 '$(VSInstallDir)/VC/atlmfc/include',
998 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
999 'msvs_disabled_warnings': [
1000 4100, 4127, 4396, 4503, 4512, 4819, 4995, 4702
1003 'VCCLCompilerTool': {
1004 'MinimalRebuild': 'false',
1005 'ExceptionHandling': '0',
1006 'BufferSecurityCheck': 'true',
1007 'EnableFunctionLevelLinking': 'true',
1008 'RuntimeTypeInfo': 'false',
1009 'WarningLevel': '4',
1010 'WarnAsError': 'true',
1011 'DebugInformationFormat': '3',
1013 [ 'msvs_multi_core_compile', {
1014 'AdditionalOptions': ['/MP'],
1018 'VCLibrarianTool': {
1019 'AdditionalOptions': ['/ignore:4221'],
1020 'AdditionalLibraryDirectories':
1021 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1024 'AdditionalDependencies': [
1033 'AdditionalLibraryDirectories':
1034 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
1035 'GenerateDebugInformation': 'true',
1036 'MapFileName': '$(OutDir)\\$(TargetName).map',
1037 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
1038 'FixedBaseAddress': '1',
1041 # 1 == /SUBSYSTEM:CONSOLE
1042 # 2 == /SUBSYSTEM:WINDOWS
1043 # Most of the executables we'll ever create are tests
1044 # and utilities with console output.
1048 'GenerateStublessProxies': 'true',
1049 'TypeLibraryName': '$(InputName).tlb',
1050 'OutputDirectory': '$(IntDir)',
1051 'HeaderFileName': '$(InputName).h',
1052 'DLLDataFileName': 'dlldata.c',
1053 'InterfaceIdentifierFileName': '$(InputName)_i.c',
1054 'ProxyFileName': '$(InputName)_p.c',
1056 'VCResourceCompilerTool': {
1058 'AdditionalIncludeDirectories': ['<(DEPTH)'],
1063 ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
1064 'target_defaults': {
1070 ['OS=="win" and msvs_use_common_linker_extras', {
1071 'target_defaults': {
1085 'AdditionalOptions': [
1098 'AdditionalOptions': [
1099 # safeseh is not compatible with x64
1111 ['enable_new_npdevice_api==1', {
1112 'target_defaults': {
1114 'ENABLE_NEW_NPDEVICE_API',
1120 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
1121 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
1124 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
1125 # This block adds *project-wide* configuration settings to each project
1126 # file. It's almost always wrong to put things here. Specify your
1127 # custom xcode_settings in target_defaults to add them to targets instead.
1129 # In an Xcode Project Info window, the "Base SDK for All Configurations"
1130 # setting sets the SDK on a project-wide basis. In order to get the
1131 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
1132 # here at the project level.
1133 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
1135 # The Xcode generator will look for an xcode_settings section at the root
1136 # of each dict and use it to apply settings on a file-wide basis. Most
1137 # settings should not be here, they should be in target-specific
1138 # xcode_settings sections, or better yet, should use non-Xcode-specific
1139 # settings in target dicts. SYMROOT is a special case, because many other
1140 # Xcode variables depend on it, including variables such as
1141 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
1142 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
1143 # files to appear (when present) in the UI as actual files and not red
1144 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
1145 # and therefore SYMROOT, needs to be set at the project level.
1146 'SYMROOT': '<(DEPTH)/xcodebuild',