The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / v8 / build / standalone.gypi @ f230a1cf

History | View | Annotate | Download (10.8 KB)

1
# Copyright 2012 the V8 project authors. All rights reserved.
2
# Redistribution and use in source and binary forms, with or without
3
# modification, are permitted provided that the following conditions are
4
# met:
5
#
6
#     * Redistributions of source code must retain the above copyright
7
#       notice, this list of conditions and the following disclaimer.
8
#     * Redistributions in binary form must reproduce the above
9
#       copyright notice, this list of conditions and the following
10
#       disclaimer in the documentation and/or other materials provided
11
#       with the distribution.
12
#     * Neither the name of Google Inc. nor the names of its
13
#       contributors may be used to endorse or promote products derived
14
#       from this software without specific prior written permission.
15
#
16
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27

    
28
# Definitions to be used when building stand-alone V8 binaries.
29

    
30
{
31
  # We need to include toolchain.gypi here for third-party sources that don't
32
  # directly include it themselves.
33
  'includes': ['toolchain.gypi'],
34
  'variables': {
35
    'component%': 'static_library',
36
    'clang%': 0,
37
    'visibility%': 'hidden',
38
    'v8_enable_backtrace%': 0,
39
    'v8_enable_i18n_support%': 1,
40
    'msvs_multi_core_compile%': '1',
41
    'mac_deployment_target%': '10.5',
42
    'variables': {
43
      'variables': {
44
        'variables': {
45
          'conditions': [
46
            ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
47
               OS=="netbsd" or OS=="mac"', {
48
              # This handles the Unix platforms we generally deal with.
49
              # Anything else gets passed through, which probably won't work
50
              # very well; such hosts should pass an explicit target_arch
51
              # to gyp.
52
              'host_arch%':
53
                '<!(uname -m | sed -e "s/i.86/ia32/;\
54
                  s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/mips.*/mipsel/")',
55
            }, {
56
              # OS!="linux" and OS!="freebsd" and OS!="openbsd" and
57
              # OS!="netbsd" and OS!="mac"
58
              'host_arch%': 'ia32',
59
            }],
60
          ],
61
        },
62
        'host_arch%': '<(host_arch)',
63
        'target_arch%': '<(host_arch)',
64
      },
65
      'host_arch%': '<(host_arch)',
66
      'target_arch%': '<(target_arch)',
67
      'v8_target_arch%': '<(target_arch)',
68
    },
69
    'host_arch%': '<(host_arch)',
70
    'target_arch%': '<(target_arch)',
71
    'v8_target_arch%': '<(v8_target_arch)',
72
    'werror%': '-Werror',
73

    
74
    # .gyp files or targets should set v8_code to 1 if they build V8 specific
75
    # code, as opposed to external code.  This variable is used to control such
76
    # things as the set of warnings to enable, and whether warnings are treated
77
    # as errors.
78
    'v8_code%': 0,
79

    
80
    # Speeds up Debug builds:
81
    # 0 - Compiler optimizations off (debuggable) (default). This may
82
    #     be 5x slower than Release (or worse).
83
    # 1 - Turn on compiler optimizations. This may be hard or impossible to
84
    #     debug. This may still be 2x slower than Release (or worse).
85
    # 2 - Turn on optimizations, and also #undef DEBUG / #define NDEBUG
86
    #     (but leave V8_ENABLE_CHECKS and most other assertions enabled.
87
    #     This may cause some v8 tests to fail in the Debug configuration.
88
    #     This roughly matches the performance of a Release build and can
89
    #     be used by embedders that need to build their own code as debug
90
    #     but don't want or need a debug version of V8. This should produce
91
    #     near-release speeds.
92
    'v8_optimized_debug%': 0,
93

    
94
    # Relative path to icu.gyp from this file.
95
    'icu_gyp_path': '../third_party/icu/icu.gyp',
96

    
97
    'conditions': [
98
      ['(v8_target_arch=="arm" and host_arch!="arm") or \
99
        (v8_target_arch=="mipsel" and host_arch!="mipsel") or \
100
        (v8_target_arch=="x64" and host_arch!="x64") or \
101
        (OS=="android")', {
102
        'want_separate_host_toolset': 1,
103
      }, {
104
        'want_separate_host_toolset': 0,
105
      }],
106
      ['OS == "win"', {
107
        'os_posix%': 0,
108
      }, {
109
        'os_posix%': 1,
110
      }],
111
      ['(v8_target_arch=="ia32" or v8_target_arch=="x64") and \
112
        (OS=="linux" or OS=="mac")', {
113
        'v8_enable_gdbjit%': 1,
114
      }, {
115
        'v8_enable_gdbjit%': 0,
116
      }],
117
    ],
118
    # Default ARM variable settings.
119
    'armv7%': 'default',
120
    'arm_neon%': 0,
121
    'arm_fpu%': 'vfpv3',
122
    'arm_float_abi%': 'default',
123
    'arm_thumb': 'default',
124
  },
125
  'target_defaults': {
126
    'variables': {
127
      'v8_code%': '<(v8_code)',
128
    },
129
    'default_configuration': 'Debug',
130
    'configurations': {
131
      'Debug': {
132
        'cflags': [ '-g', '-O0' ],
133
      },
134
      'Release': {
135
        # Xcode insists on this empty entry.
136
      },
137
    },
138
    'target_conditions': [
139
      ['v8_code == 0', {
140
        'defines!': [
141
          'DEBUG',
142
        ],
143
        'conditions': [
144
          ['os_posix == 1 and OS != "mac"', {
145
            'cflags!': [
146
              '-Werror',
147
            ],
148
          }],
149
          ['OS == "mac"', {
150
            'xcode_settings': {
151
              'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
152
            },
153
          }],
154
          ['OS == "win"', {
155
            'msvs_settings': {
156
              'VCCLCompilerTool': {
157
                'WarnAsError': 'false',
158
              },
159
            },
160
          }],
161
        ],
162
      }],
163
    ],
164
  },
165
  'conditions': [
166
    ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
167
       or OS=="netbsd"', {
168
      'target_defaults': {
169
        'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
170
                    '-pthread', '-fno-exceptions', '-pedantic' ],
171
        'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti' ],
172
        'ldflags': [ '-pthread', ],
173
        'conditions': [
174
          [ 'OS=="linux"', {
175
            'cflags': [ '-ansi' ],
176
          }],
177
          [ 'visibility=="hidden" and v8_enable_backtrace==0', {
178
            'cflags': [ '-fvisibility=hidden' ],
179
          }],
180
          [ 'component=="shared_library"', {
181
            'cflags': [ '-fPIC', ],
182
          }],
183
        ],
184
      },
185
    }],
186
    # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
187
    #  or OS=="netbsd"'
188
    ['OS=="win"', {
189
      'target_defaults': {
190
        'defines': [
191
          '_CRT_SECURE_NO_DEPRECATE',
192
          '_CRT_NONSTDC_NO_DEPRECATE',
193
        ],
194
        'conditions': [
195
          ['component=="static_library"', {
196
            'defines': [
197
              '_HAS_EXCEPTIONS=0',
198
            ],
199
          }],
200
        ],
201
        'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
202
        'msvs_disabled_warnings': [4355, 4800],
203
        'msvs_settings': {
204
          'VCCLCompilerTool': {
205
            'MinimalRebuild': 'false',
206
            'BufferSecurityCheck': 'true',
207
            'EnableFunctionLevelLinking': 'true',
208
            'RuntimeTypeInfo': 'false',
209
            'WarningLevel': '3',
210
            'WarnAsError': 'true',
211
            'DebugInformationFormat': '3',
212
            'Detect64BitPortabilityProblems': 'false',
213
            'conditions': [
214
              [ 'msvs_multi_core_compile', {
215
                'AdditionalOptions': ['/MP'],
216
              }],
217
              ['component=="shared_library"', {
218
                'ExceptionHandling': '1',  # /EHsc
219
              }, {
220
                'ExceptionHandling': '0',
221
              }],
222
            ],
223
          },
224
          'VCLibrarianTool': {
225
            'AdditionalOptions': ['/ignore:4221'],
226
          },
227
          'VCLinkerTool': {
228
            'AdditionalDependencies': [
229
              'ws2_32.lib',
230
            ],
231
            'GenerateDebugInformation': 'true',
232
            'MapFileName': '$(OutDir)\\$(TargetName).map',
233
            'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
234
            'FixedBaseAddress': '1',
235
            # LinkIncremental values:
236
            #   0 == default
237
            #   1 == /INCREMENTAL:NO
238
            #   2 == /INCREMENTAL
239
            'LinkIncremental': '1',
240
            # SubSystem values:
241
            #   0 == not set
242
            #   1 == /SUBSYSTEM:CONSOLE
243
            #   2 == /SUBSYSTEM:WINDOWS
244
            'SubSystem': '1',
245

    
246
            'conditions': [
247
              ['v8_enable_i18n_support==1', {
248
                'AdditionalDependencies': [
249
                  'advapi32.lib',
250
                ],
251
              }],
252
            ],
253
          },
254
        },
255
      },
256
    }],  # OS=="win"
257
    ['OS=="mac"', {
258
      'xcode_settings': {
259
        'SYMROOT': '<(DEPTH)/xcodebuild',
260
      },
261
      'target_defaults': {
262
        'xcode_settings': {
263
          'ALWAYS_SEARCH_USER_PATHS': 'NO',
264
          'GCC_C_LANGUAGE_STANDARD': 'ansi',        # -ansi
265
          'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
266
          'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
267
                                                    # (Equivalent to -fPIC)
268
          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
269
          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
270
          'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
271
          # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
272
          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
273
          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
274
          'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
275
          'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
276
          'GCC_VERSION': 'com.apple.compilers.llvmgcc42',
277
          'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
278
          'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
279
          # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
280
          'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
281
          'PREBINDING': 'NO',                       # No -Wl,-prebind
282
          'SYMROOT': '<(DEPTH)/xcodebuild',
283
          'USE_HEADERMAP': 'NO',
284
          'OTHER_CFLAGS': [
285
            '-fno-strict-aliasing',
286
          ],
287
          'WARNING_CFLAGS': [
288
            '-Wall',
289
            '-Wendif-labels',
290
            '-W',
291
            '-Wno-unused-parameter',
292
          ],
293
        },
294
        'target_conditions': [
295
          ['_type!="static_library"', {
296
            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
297
          }],
298
        ],  # target_conditions
299
      },  # target_defaults
300
    }],  # OS=="mac"
301
  ],
302
}