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