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{
29  'variables': {
30    'v8_code': 1,
31    'console%': '',
32    # Enable support for Intel VTune. Supported on ia32/x64 only
33    'v8_enable_vtunejit%': 0,
34    'v8_enable_i18n_support%': 1,
35    'v8_toolset_for_d8%': 'target',
36  },
37  'includes': ['../build/toolchain.gypi', '../build/features.gypi'],
38  'targets': [
39    {
40      'target_name': 'd8',
41      'type': 'executable',
42      'dependencies': [
43        '../tools/gyp/v8.gyp:v8',
44        '../tools/gyp/v8.gyp:v8_libplatform',
45      ],
46      # Generated source files need this explicitly:
47      'include_dirs+': [
48        '..',
49      ],
50      'sources': [
51        'd8.cc',
52      ],
53      'conditions': [
54        [ 'want_separate_host_toolset==1', {
55          'toolsets': [ '<(v8_toolset_for_d8)', ],
56        }],
57        [ 'console=="readline"', {
58          'libraries': [ '-lreadline', ],
59          'sources': [ 'd8-readline.cc' ],
60        }],
61        ['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \
62           or OS=="openbsd" or OS=="solaris" or OS=="android" \
63           or OS=="qnx")', {
64             'sources': [ 'd8-posix.cc', ]
65           }],
66        [ 'OS=="win"', {
67          'sources': [ 'd8-windows.cc', ]
68        }],
69        [ 'component!="shared_library"', {
70          'sources': [ 'd8-debug.cc', '<(SHARED_INTERMEDIATE_DIR)/d8-js.cc', ],
71          'conditions': [
72            [ 'want_separate_host_toolset==1', {
73              'dependencies': [
74                'd8_js2c#host',
75              ],
76            }, {
77              'dependencies': [
78                'd8_js2c',
79              ],
80            }],
81          ],
82        }],
83        ['v8_enable_vtunejit==1', {
84          'dependencies': [
85            '../src/third_party/vtune/v8vtune.gyp:v8_vtune',
86          ],
87        }],
88        ['v8_enable_i18n_support==1', {
89          'dependencies': [
90            '<(icu_gyp_path):icui18n',
91            '<(icu_gyp_path):icuuc',
92          ],
93        }],
94        ['OS=="win" and v8_enable_i18n_support==1', {
95          'dependencies': [
96            '<(icu_gyp_path):icudata',
97          ],
98        }],
99      ],
100    },
101    {
102      'target_name': 'd8_js2c',
103      'type': 'none',
104      'variables': {
105        'js_files': [
106          'd8.js',
107          'macros.py',
108        ],
109      },
110      'conditions': [
111        [ 'want_separate_host_toolset==1', {
112          'toolsets': ['host'],
113        }, {
114          'toolsets': ['target'],
115        }]
116      ],
117      'actions': [
118        {
119          'action_name': 'd8_js2c',
120          'inputs': [
121            '../tools/js2c.py',
122            '<@(js_files)',
123          ],
124          'outputs': [
125            '<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
126          ],
127          'action': [
128            'python',
129            '../tools/js2c.py',
130            '<@(_outputs)',
131            'D8',
132            'off',  # compress startup data
133            '<@(js_files)'
134          ],
135        },
136      ],
137    }
138  ],
139}
140