Initial Implementation of Node prelaunch
[platform/framework/web/crosswalk-tizen.git] / common.gypi
1 {
2   'includes': [
3     'vendor/brightray/brightray.gypi',
4   ],
5   'conditions': [
6     ['use_efl!=1', {
7       'includes': [
8         'toolchain.gypi',
9       ],
10     }]
11    ],
12
13   'variables': {
14     # Tell crashpad to build as external project.
15     'crashpad_dependencies': 'external',
16     # Required by breakpad.
17     'os_bsd': 0,
18     'chromeos': 0,
19     # Reflects node's config.gypi.
20     'component%': 'static_library',
21     'python': 'python',
22     'openssl_fips': '',
23     'openssl_no_asm': 1,
24     'use_openssl_def': 0,
25     'OPENSSL_PRODUCT': 'libopenssl.a',
26     'node_release_urlbase': 'https://atom.io/download/atom-shell',
27     'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
28     'node_target_type': 'shared_library',
29     'node_install_npm': 'false',
30     'node_prefix': '',
31     'node_shared': 'true',
32     'node_shared_cares': 'false',
33     'node_shared_http_parser': 'false',
34     'node_shared_libuv': 'false',
35     'node_shared_openssl': 'false',
36     'node_shared_v8': 'true',
37     'node_shared_zlib': 'false',
38     'node_tag': '',
39     'node_use_dtrace': 'false',
40     'node_use_etw': 'false',
41     'node_use_mdb': 'false',
42     'node_use_openssl': 'true',
43     'node_use_perfctr': 'false',
44     'node_use_v8_platform': 'false',
45     'node_use_bundled_v8': 'false',
46     'node_enable_d8': 'false',
47     'uv_library': 'static_library',
48     'uv_parent_path': 'vendor/node/deps/uv',
49     'uv_use_dtrace': 'false',
50     'V8_BASE': '',
51     'v8_postmortem_support': 'false',
52     'v8_enable_i18n_support': 'false',
53     'v8_inspector': 'false',
54   },
55   # Settings to compile node under Windows.
56   'target_defaults': {
57     'target_conditions': [
58       ['_target_name in ["libuv", "http_parser", "openssl", "openssl-cli", "cares", "node", "zlib"]', {
59         'msvs_disabled_warnings': [
60           4003,  # not enough actual parameters for macro 'V'
61           4013,  # 'free' undefined; assuming extern returning int
62           4018,  # signed/unsigned mismatch
63           4054,  #
64           4055,  # 'type cast' : from data pointer 'void *' to function pointer
65           4057,  # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *'
66           4065,  # switch statement contains 'default' but no 'case' labels
67           4189,  #
68           4131,  # uses old-style declarator
69           4133,  # incompatible types
70           4146,  # unary minus operator applied to unsigned type, result still unsigned
71           4164,  # intrinsic function not declared
72           4152,  # function/data pointer conversion in expression
73           4206,  # translation unit is empty
74           4204,  # non-constant aggregate initializer
75           4210,  # nonstandard extension used : function given file scope
76           4214,  # bit field types other than int
77           4232,  # address of dllimport 'free' is not static, identity not guaranteed
78           4291,  # no matching operator delete found
79           4295,  # array is too small to include a terminating null character
80           4311,  # 'type cast': pointer truncation from 'void *const ' to 'unsigned long'
81           4389,  # '==' : signed/unsigned mismatch
82           4456,  # declaration of 'm' hides previous local declaration
83           4457,  # declaration of 'message' hides function parameter
84           4459,  # declaration of 'wq' hides global declaration
85           4477,  # format string '%.*s' requires an argument of type 'int'
86           4505,  # unreferenced local function has been removed
87           4701,  # potentially uninitialized local variable 'sizew' used
88           4703,  # potentially uninitialized local pointer variable 'req' used
89           4706,  # assignment within conditional expression
90           4804,  # unsafe use of type 'bool' in operation
91           4996,  # this function or variable may be unsafe.
92         ],
93         'msvs_settings': {
94           'VCCLCompilerTool': {
95             'WarnAsError': 'false',
96           },
97         },
98         'xcode_settings': {
99           'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
100           'WARNING_CFLAGS': [
101             '-Wno-unknown-warning-option',
102             '-Wno-parentheses-equality',
103             '-Wno-unused-function',
104             '-Wno-sometimes-uninitialized',
105             '-Wno-pointer-sign',
106             '-Wno-sign-compare',
107             '-Wno-string-plus-int',
108             '-Wno-unused-variable',
109             '-Wno-deprecated-declarations',
110             '-Wno-return-type',
111             '-Wno-gnu-folding-constant',
112             '-Wno-shift-negative-value',
113             '-Wno-varargs', # https://git.io/v6Olj
114           ],
115         },
116         'conditions': [
117           ['OS=="linux"', {
118             'cflags': [
119               '-Wno-parentheses-equality',
120               '-Wno-unused-function',
121               '-Wno-sometimes-uninitialized',
122               '-Wno-pointer-sign',
123               '-Wno-string-plus-int',
124               '-Wno-unused-variable',
125               '-Wno-unused-value',
126               '-Wno-deprecated-declarations',
127               '-Wno-return-type',
128               '-Wno-shift-negative-value',
129               '-Wno-format',
130               '-Wno-varargs', # https://git.io/v6Olj
131               # Required when building as shared library.
132               '-fPIC',
133             ],
134           }],
135         ],
136       }],
137       ['_target_name=="node"', {
138         'include_dirs': [
139           '<(libchromiumcontent_src_dir)',
140           '<(libchromiumcontent_src_dir)/third_party/icu/source/common',
141           '<(libchromiumcontent_src_dir)/third_party/icu/source/i18n',
142           '<(libchromiumcontent_src_dir)/v8',
143           '<(libchromiumcontent_src_dir)/v8/include',
144         ],
145         'conditions': [
146           ['OS=="mac" and libchromiumcontent_component==0', {
147             # -all_load is the "whole-archive" on macOS.
148             'xcode_settings': {
149               'OTHER_LDFLAGS': [ '-Wl,-all_load' ],
150             },
151           }],
152           ['OS=="win"', {
153             # Fix passing fd across modules, see |osfhandle.h| for more.
154             'sources': [
155               '<(DEPTH)/atom/node/osfhandle.cc',
156               '<(DEPTH)/atom/node/osfhandle.h',
157             ],
158             'include_dirs': [
159               '<(DEPTH)/atom/node',
160             ],
161             'libraries': [
162               # Node is using networking API but linking with this itself.
163               '-lwinmm.lib',
164               # Needed by V8.
165               '-ldbghelp.lib',
166               '-lshlwapi.lib',
167             ],
168           }],
169           ['OS=="linux" and libchromiumcontent_component==0', {
170             # Prevent the linker from stripping symbols.
171             'ldflags': [
172               '-Wl,--whole-archive',
173               '<@(libchromiumcontent_v8_libraries)',
174               '-Wl,--no-whole-archive',
175             ],
176           }, {
177             'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
178           }],
179         ],
180       }],
181       ['_target_name=="openssl"', {
182         'xcode_settings': {
183           'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
184           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
185           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
186         },
187         'cflags': [
188           '-fvisibility=hidden',
189         ],
190       }],
191       ['_target_name=="libuv"', {
192         'conditions': [
193           ['OS=="win"', {
194             # Expose libuv's symbols.
195             'defines': [
196               'BUILDING_UV_SHARED=1',
197             ],
198           }],  # OS=="win"
199         ],
200       }],
201       ['_target_name.startswith("crashpad")', {
202         'conditions': [
203           ['OS=="mac"', {
204             'xcode_settings': {
205               'WARNING_CFLAGS': [
206                 '-Wno-unused-private-field',
207                 '-Wno-address-of-packed-member',
208               ],
209             },
210           }],  # OS=="mac"
211         ],
212       }],
213       ['_target_name.startswith("breakpad") or _target_name in ["crash_report_sender", "dump_syms"]', {
214         'conditions': [
215           ['OS=="mac"', {
216             'xcode_settings': {
217               'WARNING_CFLAGS': [
218                 '-Wno-deprecated-declarations',
219                 '-Wno-deprecated-register',
220                 '-Wno-unused-private-field',
221                 '-Wno-unused-function',
222               ],
223             },
224           }],  # OS=="mac"
225           ['OS=="linux"', {
226             'cflags': [
227               '-Wno-empty-body',
228             ],
229           }],  # OS=="linux"
230           ['OS=="win"', {
231             'msvs_disabled_warnings': [
232               # unreferenced local function has been removed.
233               4505,
234             ],
235           }],  # OS=="win"
236         ],
237       }],
238     ],
239     'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
240     'msvs_disabled_warnings': [
241       4005,  # (node.h) macro redefinition
242       4091,  # (node_extern.h) '__declspec(dllimport)' : ignored on left of 'node::Environment' when no variable is declared
243       4099,  # (pdf_render_settings.h) type name first seen using 'class' now seen using 'struct'
244       4189,  # local variable is initialized but not referenced
245       4201,  # (uv.h) nameless struct/union
246       4267,  # conversion from 'size_t' to 'int', possible loss of data
247       4302,  # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD'
248       4458,  # (atldlgs.h) declaration of 'dwCommonButtons' hides class member
249       4503,  # decorated name length exceeded, name was truncated
250       4800,  # (v8.h) forcing value to bool 'true' or 'false'
251       4819,  # The file contains a character that cannot be represented in the current code page
252       4838,  # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion
253       4996,  # (atlapp.h) 'GetVersionExW': was declared deprecated
254     ],
255   },
256   'conditions': [
257     # The breakdpad on Windows assumes Debug_x64 and Release_x64 configurations.
258     ['OS=="win"', {
259       'target_defaults': {
260         'configurations': {
261           'Debug_x64': {
262           },
263           'Release_x64': {
264           },
265         },
266       },
267     }],  # OS=="win"
268     # The breakdpad on Mac assumes Release_Base configuration.
269     ['OS=="mac"', {
270       'target_defaults': {
271         'configurations': {
272           'Release_Base': {
273           },
274         },
275       },
276     }],  # OS=="mac"
277   ],
278 }