deps: upgrade to npm 2.14.18
[platform/upstream/nodejs.git] / deps / cares / common.gypi
1 {
2   'variables': {
3     'visibility%': 'hidden',
4     'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
5     'component%': 'static_library',
6     'host_arch%': '',
7     'target_arch%': ''
8    },
9
10   'target_defaults': {
11     'default_configuration': 'Debug',
12     'configurations': {
13
14       'Debug': {
15         'defines': [ 'DEBUG', '_DEBUG' ],
16         'cflags': [ '-g', '-O0' ],
17         'msvs_settings': {
18           'VCCLCompilerTool': {
19             'target_conditions': [
20               ['library=="static_library"', {
21                 'RuntimeLibrary': 1 # static debug
22               }, {
23                 'RuntimeLibrary': 3 # DLL debug
24               }]
25             ],
26             'Optimization': 0, # /Od, no optimization
27             'MinimalRebuild': 'false',
28             'OmitFramePointers': 'false',
29             'BasicRuntimeChecks': 3 # /RTC1
30           },
31           'VCLinkerTool': {
32             'LinkIncremental': 2 # enable incremental linking
33           }
34         },
35         'xcode_settings': {
36           'GCC_OPTIMIZATION_LEVEL': '0'
37         }
38       },
39
40       'Release': {
41         'defines': [ 'NDEBUG' ],
42         'cflags': [
43           '-O3',
44           '-fomit-frame-pointer',
45           '-fdata-sections',
46           '-ffunction-sections'
47         ],
48         'msvs_settings': {
49           'VCCLCompilerTool': {
50             'target_conditions': [
51               ['library=="static_library"', {
52                 'RuntimeLibrary': 0, # static release
53               }, {
54                 'RuntimeLibrary': 2, # debug release
55               }],
56             ],
57             'Optimization': 3, # /Ox, full optimization
58             'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
59             'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
60             'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
61             'OmitFramePointers': 'true',
62             'EnableFunctionLevelLinking': 'true',
63             'EnableIntrinsicFunctions': 'true'
64           },
65           'VCLibrarianTool': {
66             'AdditionalOptions': [
67               '/LTCG' # link time code generation
68             ]
69           },
70           'VCLinkerTool': {
71             'LinkTimeCodeGeneration': 1, # link-time code generation
72             'OptimizeReferences': 2, # /OPT:REF
73             'EnableCOMDATFolding': 2, # /OPT:ICF
74             'LinkIncremental': 1 # disable incremental linking
75           },
76         },
77       }
78     },
79
80     'msvs_settings': {
81       'VCCLCompilerTool': {
82         'StringPooling': 'true', # pool string literals
83         'DebugInformationFormat': 3, # Generate a PDB
84         'WarningLevel': 3,
85         'BufferSecurityCheck': 'true',
86         'ExceptionHandling': 1, # /EHsc
87         'SuppressStartupBanner': 'true',
88         'WarnAsError': 'false',
89         'AdditionalOptions': [
90            '/MP', # compile across multiple CPUs
91          ],
92       },
93       'VCLinkerTool': {
94         'GenerateDebugInformation': 'true',
95         'RandomizedBaseAddress': 2, # enable ASLR
96         'DataExecutionPrevention': 2, # enable DEP
97         'AllowIsolation': 'true',
98         'SuppressStartupBanner': 'true',
99         'target_conditions': [
100           ['_type=="executable"', {
101             'SubSystem': 1, # console executable
102           }],
103         ],
104       },
105     },
106
107     'xcode_settings': {
108       'ALWAYS_SEARCH_USER_PATHS': 'NO',
109       'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
110       'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
111       'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
112       'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
113       # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
114       'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
115       'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
116       'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
117       'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
118       'PREBINDING': 'NO',                       # No -Wl,-prebind
119       'USE_HEADERMAP': 'NO',
120       'WARNING_CFLAGS': [
121         '-Wall',
122         '-Wendif-labels',
123         '-W',
124         '-Wno-unused-parameter'
125       ]
126     },
127
128     'conditions': [
129       ['OS == "win"', {
130         'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
131         'defines': [
132           'WIN32',
133           # we don't want VC++ warning us about how dangerous C functions are.
134           '_CRT_SECURE_NO_DEPRECATE',
135           # ... or that C implementations shouldn't use POSIX names
136           '_CRT_NONSTDC_NO_DEPRECATE'
137         ],
138       }],
139
140       [ 'OS in "linux freebsd openbsd solaris android aix"', {
141         'variables': {
142           'gcc_version%': '<!(python build/gcc_version.py)>)'
143         },
144         'cflags': [ '-Wall' ],
145         'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
146         'conditions': [
147           [ 'host_arch != target_arch and target_arch=="ia32"', {
148             'cflags': [ '-m32' ],
149             'ldflags': [ '-m32' ]
150           }],
151           [ 'OS=="linux"', {
152             'cflags': [ '-ansi' ]
153           }],
154           [ 'visibility=="hidden" and gcc_version >= "4.0.0"', {
155             'cflags': [ '-fvisibility=hidden' ]
156           }],
157         ]
158       }]
159     ],
160
161     'target_conditions': [
162       ['_type!="static_library"', {
163         'cflags': [ '-fPIC' ],
164         'xcode_settings': {
165           'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
166                                       # (Equivalent to -fPIC)
167           'OTHER_LDFLAGS': [ '-Wl,-search_paths_first' ]
168         }
169       }]
170     ]
171   }
172 }