Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / build / common.gypi
1 # Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 {
6     'includes': [ 'common_defines.gypi', ],
7     'variables':
8     {
9         'angle_build_tests%': '1',
10         'angle_build_samples%': '1',
11         # angle_code is set to 1 for the core ANGLE targets defined in src/build_angle.gyp.
12         # angle_code is set to 0 for test code, sample code, and third party code.
13         # When angle_code is 1, we build with additional warning flags on Mac and Linux.
14         'angle_code%': 0,
15         'release_symbols%': 'true',
16         'gcc_or_clang_warnings':
17         [
18             '-Wall',
19             '-Wchar-subscripts',
20             '-Werror',
21             '-Wextra',
22             '-Wformat=2',
23             '-Winit-self',
24             '-Wno-sign-compare',
25             '-Wno-unused-function',
26             '-Wno-unused-parameter',
27             '-Wno-unknown-pragmas',
28             '-Wpacked',
29             '-Wpointer-arith',
30             '-Wundef',
31             '-Wwrite-strings',
32             '-Wno-reorder',
33             '-Wno-format-nonliteral',
34         ],
35     },
36     'target_defaults':
37     {
38         'default_configuration': 'Debug',
39         'variables':
40         {
41             'warn_as_error%': 1,
42         },
43         'target_conditions':
44         [
45             ['warn_as_error == 1',
46             {
47                 'msvs_settings':
48                 {
49                     'VCCLCompilerTool':
50                     {
51                         'WarnAsError': 'true',
52                     },
53                 },
54             }],
55         ],
56         'configurations':
57         {
58             'Common_Base':
59             {
60                 'abstract': 1,
61                 'msvs_configuration_attributes':
62                 {
63                     'OutputDirectory': '$(SolutionDir)$(ConfigurationName)_$(Platform)',
64                     'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
65                     'CharacterSet': '0',    # ASCII
66                 },
67                 'msvs_settings':
68                 {
69                     'VCCLCompilerTool':
70                     {
71                         'AdditionalOptions': ['/MP'],
72                         'BufferSecurityCheck': 'true',
73                         'DebugInformationFormat': '3',
74                         'ExceptionHandling': '0',
75                         'EnableFunctionLevelLinking': 'true',
76                         'MinimalRebuild': 'false',
77                         'RuntimeTypeInfo': 'true',
78                         'WarningLevel': '4',
79                     },
80                     'VCLinkerTool':
81                     {
82                         'FixedBaseAddress': '1',
83                         'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
84                         'MapFileName': '$(OutDir)\\$(TargetName).map',
85                         # Most of the executables we'll ever create are tests
86                         # and utilities with console output.
87                         'SubSystem': '1',    # /SUBSYSTEM:CONSOLE
88                     },
89                     'VCResourceCompilerTool':
90                     {
91                         'Culture': '1033',
92                     },
93                 },
94             },    # Common_Base
95
96             'Debug_Base':
97             {
98                 'abstract': 1,
99                 'msvs_settings':
100                 {
101                     'VCCLCompilerTool':
102                     {
103                         'Optimization': '0',    # /Od
104                         'BasicRuntimeChecks': '3',
105                         'RuntimeLibrary': '1',    # /MTd (debug static)
106                     },
107                     'VCLinkerTool':
108                     {
109                         'GenerateDebugInformation': 'true',
110                         'LinkIncremental': '2',
111                     },
112                 },
113                 'xcode_settings':
114                 {
115                     'COPY_PHASE_STRIP': 'NO',
116                     'GCC_OPTIMIZATION_LEVEL': '0',
117                 },
118             },    # Debug_Base
119
120             'Release_Base':
121             {
122                 'abstract': 1,
123                 'msvs_settings':
124                 {
125                     'VCCLCompilerTool':
126                     {
127                         'Optimization': '2',    # /Os
128                         'RuntimeLibrary': '0',    # /MT (static)
129                     },
130                     'VCLinkerTool':
131                     {
132                         'GenerateDebugInformation': '<(release_symbols)',
133                         'LinkIncremental': '1',
134                     },
135                 },
136             },    # Release_Base
137
138             'x86_Base':
139             {
140                 'abstract': 1,
141                 'msvs_configuration_platform': 'Win32',
142                 'msvs_settings':
143                 {
144                     'VCLinkerTool':
145                     {
146                         'TargetMachine': '1',
147                         'AdditionalLibraryDirectories':
148                         [
149                             '<(windows_sdk_path)/Lib/win8/um/x86',
150                         ],
151                     },
152                     'VCLibrarianTool':
153                     {
154                         'AdditionalLibraryDirectories':
155                         [
156                             '<(windows_sdk_path)/Lib/win8/um/x86',
157                         ],
158                     },
159                 },
160             }, # x86_Base
161
162             'x64_Base':
163             {
164                 'abstract': 1,
165                 'msvs_configuration_platform': 'x64',
166                 'msvs_settings':
167                 {
168                     'VCLinkerTool':
169                     {
170                         'TargetMachine': '17', # x86 - 64
171                         'AdditionalLibraryDirectories':
172                         [
173                             '<(windows_sdk_path)/Lib/win8/um/x64',
174                         ],
175                     },
176                     'VCLibrarianTool':
177                     {
178                         'AdditionalLibraryDirectories':
179                         [
180                             '<(windows_sdk_path)/Lib/win8/um/x64',
181                         ],
182                     },
183                 },
184             },    # x64_Base
185
186             # Concrete configurations
187             'Debug':
188             {
189                 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
190             },
191             'Release':
192             {
193                 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
194             },
195             'conditions':
196             [
197                 [ 'OS == "win" and MSVS_VERSION != "2010e"',
198                 {
199                     'Debug_x64':
200                     {
201                         'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
202                     },
203                     'Release_x64':
204                     {
205                         'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
206                     },
207                 }],
208             ],
209         },    # configurations
210     },    # target_defaults
211     'conditions':
212     [
213         ['OS == "win"',
214         {
215             'target_defaults':
216             {
217                 'msvs_cygwin_dirs': ['../third_party/cygwin'],
218             },
219         },
220         { # OS != win
221             'target_defaults':
222             {
223                 'cflags': [ '-fPIC' ],
224             },
225         }],
226         ['OS != "win" and OS != "mac"',
227         {
228             'target_defaults':
229             {
230                 'cflags':
231                 [
232                     '-pthread',
233                     '-fno-exceptions',
234                 ],
235                 'ldflags':
236                 [
237                     '-pthread',
238                 ],
239                 'configurations':
240                 {
241                     'Debug':
242                     {
243                         'variables':
244                         {
245                             'debug_optimize%': '0',
246                         },
247                         'defines':
248                         [
249                             '_DEBUG',
250                         ],
251                         'cflags':
252                         [
253                             '-O>(debug_optimize)',
254                             '-g',
255                         ],
256                     }
257                 },
258             },
259         }],
260         ['angle_code==1',
261         {
262             'target_defaults':
263             {
264                 'conditions':
265                 [
266                     ['OS == "mac"',
267                     {
268                         'xcode_settings':
269                         {
270                             'WARNING_CFLAGS': ['<@(gcc_or_clang_warnings)']
271                         },
272                     }],
273                     ['OS != "win" and OS != "mac"',
274                     {
275                         'cflags': ['<@(gcc_or_clang_warnings)']
276                     }],
277                 ]
278             }
279         }],
280     ],
281 }