Merge remote-tracking branch 'upstream/v0.10'
[platform/upstream/nodejs.git] / deps / uv / common.gypi
1 {
2   'variables': {
3     'visibility%': 'hidden',         # V8's visibility setting
4     'target_arch%': 'ia32',          # set v8's target architecture
5     'host_arch%': 'ia32',            # set v8's host architecture
6     'library%': 'static_library',    # allow override to 'shared_library' for DLL/.so builds
7     'component%': 'static_library',  # NB. these names match with what V8 expects
8     'msvs_multi_core_compile': '0',  # we do enable multicore compiles, but not using the V8 way
9     'gcc_version%': 'unknown',
10     'clang%': 0,
11   },
12
13   'target_defaults': {
14     'default_configuration': 'Debug',
15     'configurations': {
16       'Debug': {
17         'defines': [ 'DEBUG', '_DEBUG' ],
18         'cflags': [ '-g', '-O0', '-fwrapv' ],
19         'msvs_settings': {
20           'VCCLCompilerTool': {
21             'target_conditions': [
22               ['library=="static_library"', {
23                 'RuntimeLibrary': 1, # static debug
24               }, {
25                 'RuntimeLibrary': 3, # DLL debug
26               }],
27             ],
28             'Optimization': 0, # /Od, no optimization
29             'MinimalRebuild': 'false',
30             'OmitFramePointers': 'false',
31             'BasicRuntimeChecks': 3, # /RTC1
32           },
33           'VCLinkerTool': {
34             'LinkIncremental': 2, # enable incremental linking
35           },
36         },
37         'xcode_settings': {
38           'GCC_OPTIMIZATION_LEVEL': '0',
39           'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
40         },
41         'conditions': [
42           ['OS != "win"', {
43             'defines': [ 'EV_VERIFY=2' ],
44           }],
45         ]
46       },
47       'Release': {
48         'defines': [ 'NDEBUG' ],
49         'cflags': [
50           '-O3',
51           '-fstrict-aliasing',
52           '-fomit-frame-pointer',
53           '-fdata-sections',
54           '-ffunction-sections',
55         ],
56         'msvs_settings': {
57           'VCCLCompilerTool': {
58             'target_conditions': [
59               ['library=="static_library"', {
60                 'RuntimeLibrary': 0, # static release
61               }, {
62                 'RuntimeLibrary': 2, # debug release
63               }],
64             ],
65             'Optimization': 3, # /Ox, full optimization
66             'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
67             'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
68             'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
69             'OmitFramePointers': 'true',
70             'EnableFunctionLevelLinking': 'true',
71             'EnableIntrinsicFunctions': 'true',
72           },
73           'VCLibrarianTool': {
74             'AdditionalOptions': [
75               '/LTCG', # link time code generation
76             ],
77           },
78           'VCLinkerTool': {
79             'LinkTimeCodeGeneration': 1, # link-time code generation
80             'OptimizeReferences': 2, # /OPT:REF
81             'EnableCOMDATFolding': 2, # /OPT:ICF
82             'LinkIncremental': 1, # disable incremental linking
83           },
84         },
85       }
86     },
87     'msvs_settings': {
88       'VCCLCompilerTool': {
89         'StringPooling': 'true', # pool string literals
90         'DebugInformationFormat': 3, # Generate a PDB
91         'WarningLevel': 3,
92         'BufferSecurityCheck': 'true',
93         'ExceptionHandling': 1, # /EHsc
94         'SuppressStartupBanner': 'true',
95         'WarnAsError': 'false',
96         'AdditionalOptions': [
97            '/MP', # compile across multiple CPUs
98          ],
99       },
100       'VCLibrarianTool': {
101       },
102       'VCLinkerTool': {
103         'GenerateDebugInformation': 'true',
104         'RandomizedBaseAddress': 2, # enable ASLR
105         'DataExecutionPrevention': 2, # enable DEP
106         'AllowIsolation': 'true',
107         'SuppressStartupBanner': 'true',
108         'target_conditions': [
109           ['_type=="executable"', {
110             'SubSystem': 1, # console executable
111           }],
112         ],
113       },
114     },
115     'conditions': [
116       ['OS == "win"', {
117         'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
118         'defines': [
119           'WIN32',
120           # we don't really want VC++ warning us about
121           # how dangerous C functions are...
122           '_CRT_SECURE_NO_DEPRECATE',
123           # ... or that C implementations shouldn't use
124           # POSIX names
125           '_CRT_NONSTDC_NO_DEPRECATE',
126         ],
127         'target_conditions': [
128           ['target_arch=="x64"', {
129             'msvs_configuration_platform': 'x64'
130           }]
131         ]
132       }],
133       ['OS in "freebsd linux openbsd solaris android"', {
134         'cflags': [ '-Wall' ],
135         'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
136         'target_conditions': [
137           ['_type=="static_library"', {
138             'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
139           }],
140         ],
141         'conditions': [
142           [ 'host_arch != target_arch and target_arch=="ia32"', {
143             'cflags': [ '-m32' ],
144             'ldflags': [ '-m32' ],
145           }],
146           [ 'OS=="linux"', {
147             'cflags': [ '-ansi' ],
148           }],
149           [ 'OS=="solaris"', {
150             'cflags': [ '-pthreads' ],
151             'ldflags': [ '-pthreads' ],
152           }],
153           [ 'OS not in "solaris android"', {
154             'cflags': [ '-pthread' ],
155             'ldflags': [ '-pthread' ],
156           }],
157           [ 'visibility=="hidden" and (clang==1 or gcc_version >= 40)', {
158             'cflags': [ '-fvisibility=hidden' ],
159           }],
160         ],
161       }],
162       ['OS=="mac"', {
163         'xcode_settings': {
164           'ALWAYS_SEARCH_USER_PATHS': 'NO',
165           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
166           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
167                                                     # (Equivalent to -fPIC)
168           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
169           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
170           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
171           # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
172           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
173           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
174           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
175           'PREBINDING': 'NO',                       # No -Wl,-prebind
176           'USE_HEADERMAP': 'NO',
177           'OTHER_CFLAGS': [
178             '-fstrict-aliasing',
179           ],
180           'WARNING_CFLAGS': [
181             '-Wall',
182             '-Wendif-labels',
183             '-W',
184             '-Wno-unused-parameter',
185           ],
186         },
187         'conditions': [
188           ['target_arch=="ia32"', {
189             'xcode_settings': {'ARCHS': ['i386']},
190           }],
191           ['target_arch=="x64"', {
192             'xcode_settings': {'ARCHS': ['x86_64']},
193           }],
194         ],
195         'target_conditions': [
196           ['_type!="static_library"', {
197             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
198           }],
199         ],
200       }],
201      ['OS=="solaris"', {
202        'cflags': [ '-fno-omit-frame-pointer' ],
203        # pull in V8's postmortem metadata
204        'ldflags': [ '-Wl,-z,allextract' ]
205      }],
206     ],
207   },
208 }