[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 1 | # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | { |
| 6 | 'variables': { |
[email protected] | b3fb809 | 2009-03-12 19:09:24 | [diff] [blame] | 7 | # .gyp files should set chromium_code to 1 if they build Chromium-specific |
| 8 | # code, as opposed to external code. This variable is used to control |
| 9 | # such things as the set of warnings to enable, and whether warnings are |
| 10 | # treated as errors. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 11 | 'chromium_code%': 0, |
[email protected] | b3fb809 | 2009-03-12 19:09:24 | [diff] [blame] | 12 | |
| 13 | # Variables expected to be overriden on the GYP command line (-D) or by |
| 14 | # ~/.gyp/include.gypi. |
| 15 | |
| 16 | # Override chromium_mac_pch and set it to 0 to suppress the use of |
| 17 | # precompiled headers on the Mac. Prefix header injection may still be |
| 18 | # used, but prefix headers will not be precompiled. This is useful when |
| 19 | # using distcc to distribute a build to compile slaves that don't |
| 20 | # share the same compiler executable as the system driving the compilation, |
| 21 | # because precompiled headers rely on pointers into a specific compiler |
| 22 | # executable's image. Setting this to 0 is needed to use an experimental |
| 23 | # Linux-Mac cross compiler distcc farm. |
| 24 | 'chromium_mac_pch%': 1, |
| 25 | |
| 26 | # Override branding to select the desired branding flavor. |
[email protected] | 32aa8cc | 2009-03-04 21:36:39 | [diff] [blame] | 27 | 'branding%': 'Chromium', |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 28 | |
| 29 | # Set to 1 to enable code coverage. In addition to build changes |
| 30 | # (e.g. extra CFLAGS), also creates a new target in the src/chrome |
| 31 | # project file called "coverage". |
| 32 | # Currently ignored on Windows. |
| 33 | 'coverage%': 0, |
[email protected] | 653bd5f03 | 2009-04-08 12:55:49 | [diff] [blame] | 34 | |
[email protected] | c61f643 | 2009-04-22 01:16:42 | [diff] [blame] | 35 | # Overridable specification for potential use of alternative |
| 36 | # JavaScript engines. |
| 37 | 'javascript_engine%': 'v8', |
| 38 | |
[email protected] | 653bd5f03 | 2009-04-08 12:55:49 | [diff] [blame] | 39 | # To do a shared build on linux we need to be able to choose between type |
| 40 | # static_library and shared_library. We default to doing a static build |
| 41 | # but you can override this with "gyp -Dlibrary=shared_library" or you |
| 42 | # can add the following line (without the #) to ~/.gyp/include.gypi |
| 43 | # {'variables': {'library': 'shared_library'}} |
| 44 | # to compile as shared by default |
| 45 | 'library%': 'static_library', |
[email protected] | e5b2eaa | 2009-04-14 01:39:12 | [diff] [blame] | 46 | |
| 47 | # TODO(bradnelson): eliminate this when possible. |
| 48 | # To allow local gyp files to prevent release.vsprops from being included. |
| 49 | # Yes(1) means include release.vsprops. |
| 50 | # Once all vsprops settings are migrated into gyp, this can go away. |
| 51 | 'msvs_use_common_release%': 1, |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 52 | |
[email protected] | 1ffb650 | 2009-06-02 07:46:24 | [diff] [blame^] | 53 | # TODO(sgk): eliminate this if possible. |
| 54 | # It would be nicer to support this via a setting in 'target_defaults' |
| 55 | # in chrome/app/locales/locales.gypi overriding the setting in the |
| 56 | # 'Debug' configuration in the 'target_defaults' dict below, |
| 57 | # but that doesn't work as we'd like. |
| 58 | 'msvs_debug_link_incremental%': '2', |
| 59 | |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 60 | # The architecture that we're building on. |
| 61 | 'target_arch%': 'ia32', |
[email protected] | e697023 | 2009-05-12 23:51:17 | [diff] [blame] | 62 | |
| 63 | # By default linux does not use views. To turn on views in Linux |
| 64 | # set the variable GYP_DEFINES to "toolkit_views=1", or modify |
| 65 | # ~/.gyp/include.gypi . |
| 66 | 'toolkit_views%': 0, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 67 | }, |
| 68 | 'target_defaults': { |
[email protected] | 32aa8cc | 2009-03-04 21:36:39 | [diff] [blame] | 69 | 'conditions': [ |
| 70 | ['branding=="Chrome"', { |
| 71 | 'defines': ['GOOGLE_CHROME_BUILD'], |
[email protected] | f70085e4 | 2009-05-28 20:31:48 | [diff] [blame] | 72 | 'conditions': [ |
| 73 | ['OS=="linux"', { |
| 74 | 'cflags': [ '-gstabs' ], |
| 75 | }], |
| 76 | ], |
[email protected] | 32aa8cc | 2009-03-04 21:36:39 | [diff] [blame] | 77 | }, { # else: branding!="Chrome" |
| 78 | 'defines': ['CHROMIUM_BUILD'], |
| 79 | }], |
[email protected] | 6cb1cec | 2009-05-15 03:05:20 | [diff] [blame] | 80 | ['toolkit_views==1', { |
[email protected] | e697023 | 2009-05-12 23:51:17 | [diff] [blame] | 81 | 'defines': ['TOOLKIT_VIEWS=1'], |
| 82 | }], |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 83 | ['coverage!=0', { |
| 84 | 'conditions': [ |
| 85 | ['OS=="mac"', { |
| 86 | 'xcode_settings': { |
| 87 | 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', |
| 88 | 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', |
[email protected] | 5ae4f55e | 2009-04-13 23:19:47 | [diff] [blame] | 89 | }, |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 90 | # Add -lgcov for executables, not for static_libraries. |
| 91 | # This is a delayed conditional. |
| 92 | 'target_conditions': [ |
| 93 | ['_type=="executable"', { |
| 94 | 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] }, |
[email protected] | 5ae4f55e | 2009-04-13 23:19:47 | [diff] [blame] | 95 | }], |
| 96 | ], |
| 97 | }], |
[email protected] | 7122ffd5 | 2009-04-30 23:19:00 | [diff] [blame] | 98 | # Linux gyp (into scons) doesn't like target_conditions? |
| 99 | # TODO(???): track down why 'target_conditions' doesn't work |
| 100 | # on Linux gyp into scons like it does on Mac gyp into xcodeproj. |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 101 | ['OS=="linux"', { |
| 102 | 'cflags': [ '-ftest-coverage', |
| 103 | '-fprofile-arcs' ], |
[email protected] | 7122ffd5 | 2009-04-30 23:19:00 | [diff] [blame] | 104 | 'link_settings': { 'libraries': [ '-lgcov' ] }, |
[email protected] | f5ecbba1 | 2009-04-03 04:35:18 | [diff] [blame] | 105 | }], |
| 106 | ]}, |
| 107 | # TODO(jrg): options for code coverage on Windows |
| 108 | ], |
[email protected] | 32aa8cc | 2009-03-04 21:36:39 | [diff] [blame] | 109 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 110 | 'default_configuration': 'Debug', |
| 111 | 'configurations': { |
[email protected] | 825ff8d | 2009-05-22 01:40:48 | [diff] [blame] | 112 | # VCLinkerTool LinkIncremental values below: |
| 113 | # 0 == default |
| 114 | # 1 == /INCREMENTAL:NO |
| 115 | # 2 == /INCREMENTAL |
| 116 | # Debug links incremental, Release does not. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 117 | 'Debug': { |
| 118 | 'conditions': [ |
| 119 | [ 'OS=="mac"', { |
| 120 | 'xcode_settings': { |
| 121 | 'COPY_PHASE_STRIP': 'NO', |
| 122 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 123 | } |
| 124 | }], |
| 125 | [ 'OS=="win"', { |
| 126 | 'configuration_platform': 'Win32', |
| 127 | 'msvs_configuration_attributes': { |
| 128 | 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', |
| 129 | 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
| 130 | 'CharacterSet': '1', |
| 131 | }, |
| 132 | 'msvs_settings': { |
| 133 | 'VCCLCompilerTool': { |
| 134 | 'Optimization': '0', |
| 135 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 136 | 'BasicRuntimeChecks': '3', |
| 137 | 'RuntimeLibrary': '1', |
| 138 | }, |
| 139 | 'VCLinkerTool': { |
[email protected] | 1ffb650 | 2009-06-02 07:46:24 | [diff] [blame^] | 140 | 'LinkIncremental': '<(msvs_debug_link_incremental)', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 141 | }, |
| 142 | 'VCResourceCompilerTool': { |
| 143 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 144 | }, |
| 145 | }, |
| 146 | }], |
| 147 | ], |
| 148 | }, |
| 149 | 'Release': { |
| 150 | 'defines': [ |
| 151 | 'NDEBUG', |
| 152 | ], |
| 153 | 'conditions': [ |
| 154 | [ 'OS=="mac"', { |
| 155 | 'xcode_settings': { |
| 156 | 'DEAD_CODE_STRIPPING': 'YES', |
| 157 | } |
| 158 | }], |
[email protected] | e5b2eaa | 2009-04-14 01:39:12 | [diff] [blame] | 159 | [ 'OS=="win" and msvs_use_common_release', { |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 160 | 'configuration_platform': 'Win32', |
| 161 | 'msvs_props': ['release.vsprops'], |
| 162 | }], |
[email protected] | 825ff8d | 2009-05-22 01:40:48 | [diff] [blame] | 163 | [ 'OS=="win"', { |
| 164 | 'msvs_settings': { |
| 165 | 'VCLinkerTool': { |
| 166 | 'LinkIncremental': '1', |
| 167 | }, |
| 168 | }, |
| 169 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 170 | ], |
| 171 | }, |
| 172 | }, |
| 173 | }, |
| 174 | 'conditions': [ |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 175 | ['OS=="linux"', { |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 176 | 'target_defaults': { |
[email protected] | 5315f284 | 2009-04-28 00:43:27 | [diff] [blame] | 177 | # Enable -Werror by default, but put it in a variable so it can |
| 178 | # be disabled in ~/.gyp/include.gypi on the valgrind builders. |
| 179 | 'variables': { |
| 180 | 'werror%': '-Werror', |
| 181 | }, |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 182 | 'cflags': [ |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 183 | '<(werror)', # See note above about the werror variable. |
| 184 | '-pthread', |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 185 | ], |
[email protected] | a6cf87e | 2009-04-03 04:07:38 | [diff] [blame] | 186 | 'ldflags': [ |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 187 | '-pthread', |
| 188 | ], |
[email protected] | b5e46b9 | 2009-03-26 18:58:10 | [diff] [blame] | 189 | 'scons_variable_settings': { |
| 190 | 'LIBPATH': ['$LIB_DIR'], |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 191 | # Linking of large files uses lots of RAM, so serialize links |
| 192 | # using the handy flock command from util-linux. |
[email protected] | c13fcbd | 2009-03-27 04:27:01 | [diff] [blame] | 193 | 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], |
[email protected] | 789fbb7c | 2009-04-02 16:20:31 | [diff] [blame] | 194 | 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], |
| 195 | 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 196 | |
| 197 | # We have several cases where archives depend on each other in |
| 198 | # a cyclic fashion. Since the GNU linker does only a single |
| 199 | # pass over the archives we surround the libraries with |
| 200 | # --start-group and --end-group (aka -( and -) ). That causes |
| 201 | # ld to loop over the group until no more undefined symbols |
| 202 | # are found. In an ideal world we would only make groups from |
| 203 | # those libraries which we knew to be in cycles. However, |
| 204 | # that's tough with SCons, so we bodge it by making all the |
| 205 | # archives a group by redefining the linking command here. |
| 206 | # |
| 207 | # TODO: investigate whether we still have cycles that |
| 208 | # require --{start,end}-group. There has been a lot of |
| 209 | # refactoring since this was first coded, which might have |
| 210 | # eliminated the circular dependencies. |
[email protected] | 1286292 | 2009-04-20 21:36:41 | [diff] [blame] | 211 | # |
| 212 | # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS |
| 213 | # so that we prefer our own built libraries (e.g. -lpng) to |
| 214 | # system versions of libraries that pkg-config might turn up. |
| 215 | # TODO(sgk): investigate handling this not by re-ordering the |
| 216 | # flags this way, but by adding a hook to use the SCons |
| 217 | # ParseFlags() option on the output from pkg-config. |
| 218 | 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], |
| 219 | 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], |
| 220 | 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 221 | 'IMPLICIT_COMMAND_DEPENDENCIES': 0, |
[email protected] | d064428 | 2009-04-22 00:20:29 | [diff] [blame] | 222 | # -rpath is only used when building with shared libraries. |
| 223 | 'conditions': [ |
| 224 | [ 'library=="shared_library"', { |
| 225 | 'RPATH': '$LIB_DIR', |
| 226 | }], |
| 227 | ], |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 228 | }, |
[email protected] | b5e46b9 | 2009-03-26 18:58:10 | [diff] [blame] | 229 | 'scons_import_variables': [ |
[email protected] | 52049d5c | 2009-05-01 20:32:49 | [diff] [blame] | 230 | 'AS', |
[email protected] | b5e46b9 | 2009-03-26 18:58:10 | [diff] [blame] | 231 | 'CC', |
| 232 | 'CXX', |
| 233 | 'LINK', |
| 234 | ], |
| 235 | 'scons_propagate_variables': [ |
[email protected] | 52049d5c | 2009-05-01 20:32:49 | [diff] [blame] | 236 | 'AS', |
[email protected] | b5e46b9 | 2009-03-26 18:58:10 | [diff] [blame] | 237 | 'CC', |
| 238 | 'CCACHE_DIR', |
| 239 | 'CXX', |
| 240 | 'DISTCC_DIR', |
| 241 | 'DISTCC_HOSTS', |
| 242 | 'HOME', |
[email protected] | 5ae4f55e | 2009-04-13 23:19:47 | [diff] [blame] | 243 | 'INCLUDE_SERVER_ARGS', |
| 244 | 'INCLUDE_SERVER_PORT', |
[email protected] | b5e46b9 | 2009-03-26 18:58:10 | [diff] [blame] | 245 | 'LINK', |
[email protected] | fff920a | 2009-05-08 22:35:32 | [diff] [blame] | 246 | 'CHROME_BUILD_TYPE', |
| 247 | 'CHROMIUM_BUILD', |
| 248 | 'OFFICIAL_BUILD', |
[email protected] | b5e46b9 | 2009-03-26 18:58:10 | [diff] [blame] | 249 | ], |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 250 | 'configurations': { |
| 251 | 'Debug': { |
[email protected] | c5bdc03 | 2009-04-20 19:11:31 | [diff] [blame] | 252 | 'variables': { |
| 253 | 'debug_optimize%': '0', |
| 254 | }, |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 255 | 'defines': [ |
| 256 | '_DEBUG', |
| 257 | ], |
| 258 | 'cflags': [ |
[email protected] | c5bdc03 | 2009-04-20 19:11:31 | [diff] [blame] | 259 | '-O<(debug_optimize)', |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 260 | '-g', |
[email protected] | 9a5d2a5 | 2009-05-22 03:37:45 | [diff] [blame] | 261 | # One can use '-gstabs' to enable building the debugging |
| 262 | # information in STABS format for breakpad's dumpsyms. |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 263 | ], |
[email protected] | 96fd003 | 2009-04-24 00:13:08 | [diff] [blame] | 264 | 'ldflags': [ |
| 265 | '-rdynamic', # Allows backtrace to resolve symbols. |
| 266 | ], |
[email protected] | 5315f284 | 2009-04-28 00:43:27 | [diff] [blame] | 267 | }, |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 268 | 'Release': { |
| 269 | 'cflags': [ |
| 270 | '-O2', |
[email protected] | d8cc3a6 | 2009-04-08 18:29:53 | [diff] [blame] | 271 | # Don't emit the GCC version ident directives, they just end up |
| 272 | # in the .comment section taking up binary size. |
| 273 | '-fno-ident', |
| 274 | # Put data and code in their own sections, so that unused symbols |
| 275 | # can be removed at link time with --gc-sections. |
| 276 | '-fdata-sections', |
| 277 | '-ffunction-sections', |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 278 | ], |
| 279 | }, |
[email protected] | 9a5d2a5 | 2009-05-22 03:37:45 | [diff] [blame] | 280 | # Some utility binaries need to be build with the host's native |
| 281 | # config (i.e. no 32-bit override). |
| 282 | 'Tool': { |
| 283 | 'cflags!': ['-m32', '-march=pentium4', '-msse2', '-mfpmath=sse'], |
| 284 | 'ldflags!': ['-m32'], |
| 285 | 'cflags': [ '-O2' ], |
| 286 | }, |
[email protected] | 3aacaf95 | 2009-04-02 15:34:09 | [diff] [blame] | 287 | }, |
[email protected] | 601b54022 | 2009-04-03 21:32:04 | [diff] [blame] | 288 | 'variants': { |
| 289 | 'coverage': { |
| 290 | 'cflags': ['-fprofile-arcs', '-ftest-coverage'], |
| 291 | 'ldflags': ['-fprofile-arcs'], |
| 292 | }, |
| 293 | 'profile': { |
| 294 | 'cflags': ['-pg', '-g'], |
| 295 | 'ldflags': ['-pg'], |
| 296 | }, |
| 297 | 'symbols': { |
| 298 | 'cflags': ['-g'], |
| 299 | }, |
| 300 | }, |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 301 | 'conditions': [ |
| 302 | [ 'target_arch=="arm"', { |
| 303 | 'cflags': [ |
| 304 | '-fno-exceptions', |
| 305 | '-Wall', |
| 306 | ], |
| 307 | }, { # else: target_arch != "arm" |
| 308 | 'asflags': [ |
| 309 | # Needed so that libs with .s files (e.g. libicudata.a) |
| 310 | # are compatible with the general 32-bit-ness. |
| 311 | '-32', |
| 312 | ], |
| 313 | # All floating-point computations on x87 happens in 80-bit |
| 314 | # precision. Because the C and C++ language standards allow |
| 315 | # the compiler to keep the floating-point values in higher |
| 316 | # precision than what's specified in the source and doing so |
| 317 | # is more efficient than constantly rounding up to 64-bit or |
| 318 | # 32-bit precision as specified in the source, the compiler, |
| 319 | # especially in the optimized mode, tries very hard to keep |
| 320 | # values in x87 floating-point stack (in 80-bit precision) |
| 321 | # as long as possible. This has important side effects, that |
| 322 | # the real value used in computation may change depending on |
| 323 | # how the compiler did the optimization - that is, the value |
| 324 | # kept in 80-bit is different than the value rounded down to |
| 325 | # 64-bit or 32-bit. There are possible compiler options to make |
| 326 | # this behavior consistent (e.g. -ffloat-store would keep all |
| 327 | # floating-values in the memory, thus force them to be rounded |
| 328 | # to its original precision) but they have significant runtime |
| 329 | # performance penalty. |
| 330 | # |
| 331 | # -mfpmath=sse -msse2 makes the compiler use SSE instructions |
| 332 | # which keep floating-point values in SSE registers in its |
| 333 | # native precision (32-bit for single precision, and 64-bit for |
| 334 | # double precision values). This means the floating-point value |
| 335 | # used during computation does not change depending on how the |
| 336 | # compiler optimized the code, since the value is always kept |
| 337 | # in its specified precision. |
[email protected] | ffde793 | 2009-05-29 00:39:06 | [diff] [blame] | 338 | 'conditions': [ |
| 339 | ['branding=="Chromium"', { |
| 340 | 'cflags': [ |
| 341 | '-march=pentium4', |
| 342 | '-msse2', |
| 343 | '-mfpmath=sse', |
| 344 | ], |
| 345 | }], |
| 346 | ], |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 347 | 'cflags': [ |
| 348 | '-m32', |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 349 | '-fno-exceptions', |
[email protected] | 606116d2 | 2009-05-06 22:38:23 | [diff] [blame] | 350 | '-Wall', |
| 351 | ], |
| 352 | 'ldflags': [ |
| 353 | '-m32', |
| 354 | ], |
| 355 | }], |
| 356 | ], |
[email protected] | 9d38403 | 2009-03-20 23:13:26 | [diff] [blame] | 357 | }, |
| 358 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 359 | ['OS=="mac"', { |
| 360 | 'target_defaults': { |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 361 | 'variables': { |
| 362 | # This should be 'mac_real_dsym%', but there seems to be a bug |
| 363 | # with % in variables that are intended to be set to different |
| 364 | # values in different targets, like this one. |
| 365 | 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. |
| 366 | }, |
[email protected] | d92c7c01 | 2009-03-19 19:26:42 | [diff] [blame] | 367 | 'mac_bundle': 0, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 368 | 'xcode_settings': { |
| 369 | 'ALWAYS_SEARCH_USER_PATHS': 'NO', |
| 370 | 'GCC_C_LANGUAGE_STANDARD': 'c99', |
| 371 | 'GCC_CW_ASM_SYNTAX': 'NO', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 372 | 'GCC_ENABLE_PASCAL_STRINGS': 'NO', |
| 373 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', |
[email protected] | 793c3d7 | 2009-04-10 15:46:34 | [diff] [blame] | 374 | 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 375 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', |
| 376 | 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', |
| 377 | 'GCC_VERSION': '4.2', |
| 378 | 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', |
| 379 | 'MACOSX_DEPLOYMENT_TARGET': '10.5', |
| 380 | 'PREBINDING': 'NO', |
| 381 | 'SDKROOT': 'macosx10.5', |
| 382 | 'USE_HEADERMAP': 'NO', |
| 383 | 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'], |
[email protected] | b3fb809 | 2009-03-12 19:09:24 | [diff] [blame] | 384 | 'conditions': [ |
| 385 | ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, |
| 386 | {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}], |
| 387 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 388 | }, |
| 389 | 'target_conditions': [ |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 390 | ['_type!="static_library"', { |
[email protected] | 5d7dc97 | 2009-04-16 15:30:46 | [diff] [blame] | 391 | 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, |
| 392 | }], |
| 393 | ['_mac_bundle', { |
| 394 | 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, |
[email protected] | 87fde4a | 2009-02-28 00:50:08 | [diff] [blame] | 395 | }], |
[email protected] | d92c7c01 | 2009-03-19 19:26:42 | [diff] [blame] | 396 | ['_type=="executable"', { |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 397 | 'target_conditions': [ |
| 398 | ['mac_real_dsym == 1', { |
| 399 | # To get a real .dSYM bundle produced by dsymutil, set the |
| 400 | # debug information format to dwarf-with-dsym. Since |
| 401 | # strip_from_xcode will not be used, set Xcode to do the |
| 402 | # stripping as well. |
| 403 | 'configurations': { |
| 404 | 'Release': { |
| 405 | 'xcode_settings': { |
| 406 | 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', |
| 407 | 'DEPLOYMENT_POSTPROCESSING': 'YES', |
| 408 | 'STRIP_INSTALLED_PRODUCT': 'YES', |
| 409 | }, |
| 410 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 411 | }, |
[email protected] | 2470064 | 2009-06-01 16:01:20 | [diff] [blame] | 412 | }, { # mac_real_dsym != 1 |
| 413 | # To get a fast fake .dSYM bundle, use a post-build step to |
| 414 | # produce the .dSYM and strip the executable. strip_from_xcode |
| 415 | # only operates in the Release configuration. |
| 416 | 'postbuilds': [ |
| 417 | { |
| 418 | 'variables': { |
| 419 | # Define strip_from_xcode in a variable ending in _path |
| 420 | # so that gyp understands it's a path and performs proper |
| 421 | # relativization during dict merging. |
| 422 | 'strip_from_xcode_path': 'mac/strip_from_xcode', |
| 423 | }, |
| 424 | 'postbuild_name': 'Strip If Needed', |
| 425 | 'action': ['<(strip_from_xcode_path)'], |
| 426 | }, |
| 427 | ], |
| 428 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 429 | ], |
| 430 | }], |
| 431 | ], |
| 432 | }, |
| 433 | }], |
| 434 | ['OS=="win"', { |
| 435 | 'target_defaults': { |
| 436 | 'defines': [ |
| 437 | '_WIN32_WINNT=0x0600', |
| 438 | 'WINVER=0x0600', |
| 439 | 'WIN32', |
| 440 | '_WINDOWS', |
| 441 | '_HAS_EXCEPTIONS=0', |
| 442 | 'NOMINMAX', |
| 443 | '_CRT_RAND_S', |
| 444 | 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', |
| 445 | 'WIN32_LEAN_AND_MEAN', |
| 446 | '_SECURE_ATL', |
| 447 | '_HAS_TR1=0', |
| 448 | ], |
| 449 | 'include_dirs': [ |
| 450 | '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Include', |
| 451 | '$(VSInstallDir)/VC/atlmfc/include', |
| 452 | ], |
| 453 | 'msvs_cygwin_dirs': ['../third_party/cygwin'], |
[email protected] | 684056177 | 2009-05-12 16:37:55 | [diff] [blame] | 454 | 'msvs_disabled_warnings': [4396, 4503, 4819], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 455 | 'msvs_settings': { |
| 456 | 'VCCLCompilerTool': { |
| 457 | 'MinimalRebuild': 'false', |
| 458 | 'ExceptionHandling': '0', |
| 459 | 'BufferSecurityCheck': 'true', |
| 460 | 'EnableFunctionLevelLinking': 'true', |
| 461 | 'RuntimeTypeInfo': 'false', |
| 462 | 'WarningLevel': '3', |
| 463 | 'WarnAsError': 'true', |
| 464 | 'DebugInformationFormat': '3', |
| 465 | }, |
| 466 | 'VCLibrarianTool': { |
| 467 | 'AdditionalOptions': '/ignore:4221', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 468 | 'AdditionalLibraryDirectories': |
| 469 | '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib', |
| 470 | }, |
| 471 | 'VCLinkerTool': { |
| 472 | 'AdditionalOptions': |
| 473 | '/safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat', |
| 474 | 'AdditionalDependencies': [ |
| 475 | 'wininet.lib', |
| 476 | 'version.lib', |
| 477 | 'msimg32.lib', |
| 478 | 'ws2_32.lib', |
| 479 | 'usp10.lib', |
| 480 | 'psapi.lib', |
[email protected] | 96fd003 | 2009-04-24 00:13:08 | [diff] [blame] | 481 | 'dbghelp.lib', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 482 | ], |
| 483 | 'AdditionalLibraryDirectories': |
| 484 | '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib', |
[email protected] | 96fd003 | 2009-04-24 00:13:08 | [diff] [blame] | 485 | 'DelayLoadDLLs': 'dbghelp.dll,dwmapi.dll,uxtheme.dll', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 486 | 'GenerateDebugInformation': 'true', |
| 487 | 'MapFileName': '$(OutDir)\\$(TargetName).map', |
| 488 | 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', |
| 489 | 'TargetMachine': '1', |
| 490 | 'FixedBaseAddress': '1', |
[email protected] | 825ff8d | 2009-05-22 01:40:48 | [diff] [blame] | 491 | # SubSystem values: |
| 492 | # 0 == not set |
| 493 | # 1 == /SUBSYSTEM:CONSOLE |
| 494 | # 2 == /SUBSYSTEM:WINDOWS |
| 495 | # Most of the executables we'll ever create are tests |
| 496 | # and utilities with console output. |
| 497 | 'SubSystem': '1', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 498 | }, |
| 499 | 'VCMIDLTool': { |
| 500 | 'GenerateStublessProxies': 'true', |
| 501 | 'TypeLibraryName': '$(InputName).tlb', |
| 502 | 'OutputDirectory': '$(IntDir)', |
| 503 | 'HeaderFileName': '$(InputName).h', |
| 504 | 'DLLDataFileName': 'dlldata.c', |
| 505 | 'InterfaceIdentifierFileName': '$(InputName)_i.c', |
| 506 | 'ProxyFileName': '$(InputName)_p.c', |
| 507 | }, |
| 508 | 'VCResourceCompilerTool': { |
| 509 | 'Culture' : '1033', |
[email protected] | 245b3cd59 | 2009-03-31 01:12:14 | [diff] [blame] | 510 | 'AdditionalIncludeDirectories': ['<(DEPTH)'], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 511 | }, |
| 512 | }, |
| 513 | }, |
| 514 | }], |
| 515 | ['chromium_code==0', { |
| 516 | # This section must follow the other conditon sections above because |
| 517 | # external_code.gypi expects to be merged into those settings. |
| 518 | 'includes': [ |
| 519 | 'external_code.gypi', |
| 520 | ], |
| 521 | }], |
| 522 | ], |
[email protected] | c13fcbd | 2009-03-27 04:27:01 | [diff] [blame] | 523 | 'scons_settings': { |
| 524 | 'sconsbuild_dir': '<(DEPTH)/sconsbuild', |
| 525 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 526 | 'xcode_settings': { |
| 527 | # The Xcode generator will look for an xcode_settings section at the root |
| 528 | # of each dict and use it to apply settings on a file-wide basis. Most |
| 529 | # settings should not be here, they should be in target-specific |
| 530 | # xcode_settings sections, or better yet, should use non-Xcode-specific |
| 531 | # settings in target dicts. SYMROOT is a special case, because many other |
| 532 | # Xcode variables depend on it, including variables such as |
| 533 | # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something |
| 534 | # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the |
| 535 | # files to appear (when present) in the UI as actual files and not red |
| 536 | # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
| 537 | # and therefore SYMROOT, needs to be set at the project level. |
[email protected] | bfa24b96 | 2009-03-02 00:16:16 | [diff] [blame] | 538 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 539 | }, |
| 540 | } |