Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / pdfium / build / standalone.gypi
1 # Copyright 2014 PDFium 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 # Definitions to be used when building stand-alone PDFium binaries.
6
7 {
8   'variables': {
9     'component%': 'static_library',
10     'clang%': 0,
11     'msvs_multi_core_compile%': '1',
12     'variables': {
13       'variables': {
14         'variables': {
15           'conditions': [
16             ['OS=="linux" or OS=="mac"', {
17               # This handles the Unix platforms we generally deal with.
18               # Anything else gets passed through, which probably won't work
19               # very well; such hosts should pass an explicit target_arch
20               # to gyp.
21               'host_arch%':
22                 '<!(uname -m | sed -e "s/i.86/ia32/;\
23                                        s/x86_64/x64/;\
24                                        s/amd64/x64/;\
25                                        s/arm.*/arm/;\
26                                        s/aarch64/arm64/;\
27                                        s/mips.*/mipsel/")',
28             }, {
29               # OS!="linux" and OS!="mac"
30               'host_arch%': 'ia32',
31             }],
32           ],
33         },
34         'host_arch%': '<(host_arch)',
35         'target_arch%': '<(host_arch)',
36       },
37       'host_arch%': '<(host_arch)',
38       'target_arch%': '<(target_arch)',
39     },
40     # These two are needed by V8.
41     'host_arch%': '<(host_arch)',
42     'target_arch%': '<(target_arch)',
43     'werror%': '-Werror',
44     'v8_optimized_debug%': 0,
45     'icu_gyp_path': '../v8/third_party/icu/icu.gyp',
46     'conditions': [
47       ['OS == "win"', {
48         'os_posix%': 0,
49       }, {
50         'os_posix%': 1,
51       }],
52     ],
53   },
54   'target_defaults': {
55     'default_configuration': 'Debug',
56     'configurations': {
57       'Debug': {
58         'cflags': [
59           '-g',
60           '-O0',          
61           '-fdata-sections',
62           '-ffunction-sections',
63         ],
64         'msvs_settings': {
65           'VCCLCompilerTool': {
66             'Optimization': '0',
67             'conditions': [
68               ['component=="shared_library"', {
69                 'RuntimeLibrary': '3',  # /MDd
70               }, {
71                 'RuntimeLibrary': '1',  # /MTd
72               }],
73             ],
74           },
75           'VCLinkerTool': {
76             'LinkIncremental': '2',
77           },
78         },
79         'xcode_settings': {
80           'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
81         },
82       },
83       'Release': {
84         'cflags': [
85           '-fno-strict-aliasing',
86         ],
87         'xcode_settings': {
88           'GCC_OPTIMIZATION_LEVEL': '3',  # -O3
89           'GCC_STRICT_ALIASING': 'NO',
90         },
91         'msvs_settings': {
92           'VCCLCompilerTool': {
93             'Optimization': '2',
94             'InlineFunctionExpansion': '2',
95             'EnableIntrinsicFunctions': 'true',
96             'FavorSizeOrSpeed': '0',
97             'StringPooling': 'true',
98             'conditions': [
99               ['component=="shared_library"', {
100                 'RuntimeLibrary': '2',  #/MD
101               }, {
102                 'RuntimeLibrary': '0',  #/MT
103               }],
104             ],
105           },
106           'VCLinkerTool': {
107             'LinkIncremental': '1',
108             'OptimizeReferences': '2',
109             'EnableCOMDATFolding': '2',
110           },
111         },
112         'conditions': [
113           ['OS=="linux"', {
114             'cflags': [
115               '-fdata-sections',
116               '-ffunction-sections',
117               '-O3',
118               '-O2',
119             ],
120           }],
121           ['OS=="android"', {
122             'cflags!': [
123               '-O3',
124               '-Os',
125             ],
126             'cflags': [
127               '-fdata-sections',
128               '-ffunction-sections',
129               '-O2',
130             ],
131           }],
132         ],  # conditions
133       },
134       'Debug_x64': {
135         'inherit_from': ['Debug'],
136         'msvs_configuration_platform': 'x64',
137       },
138       'Release_x64': {
139         'inherit_from': ['Release'],
140         'msvs_configuration_platform': 'x64',
141       },
142     },
143     'defines!': [
144       'DEBUG',
145     ],
146     'cflags': [
147       '-Wall',
148       '-W',
149       '-Wno-unused-parameter',
150       '-pthread',
151       '-fno-exceptions',
152       '-fvisibility=hidden',
153       '-std=gnu++0x',
154     ],
155     'cflags_cc': [
156       '-Wnon-virtual-dtor',
157       '-fno-rtti',
158     ],
159     'ldflags': [
160       '-pthread',
161     ],
162     'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
163     'msvs_configuration_attributes': {
164       'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
165       'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
166       'CharacterSet': '1',
167     },
168     'msvs_settings': {
169       'VCCLCompilerTool': {
170         'MinimalRebuild': 'false',
171         'BufferSecurityCheck': 'true',
172         'EnableFunctionLevelLinking': 'true',
173         'RuntimeTypeInfo': 'false',
174         'WarningLevel': '3',
175         'WarnAsError': 'false',
176         'DebugInformationFormat': '3',
177         'Detect64BitPortabilityProblems': 'false',
178         'conditions': [
179           [ 'msvs_multi_core_compile', {
180             'AdditionalOptions': ['/MP'],
181           }],
182           ['component=="shared_library"', {
183             'ExceptionHandling': '1',  # /EHsc
184           }, {
185             'ExceptionHandling': '0',
186           }],
187         ],
188       },
189       'VCLibrarianTool': {
190         'AdditionalOptions': ['/ignore:4221'],
191       },
192       'VCLinkerTool': {
193         'GenerateDebugInformation': 'true',
194         'LinkIncremental': '1',
195         # SubSystem values:
196         #   0 == not set
197         #   1 == /SUBSYSTEM:CONSOLE
198         #   2 == /SUBSYSTEM:WINDOWS
199         'SubSystem': '1',
200       },
201     },
202     'xcode_settings': {
203       'ALWAYS_SEARCH_USER_PATHS': 'NO',
204       'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11',
205       'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
206       'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
207                                                 # (Equivalent to -fPIC)
208       'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
209       'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
210       'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
211       # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
212       'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
213       'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
214       'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',     # -Werror
215       'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
216       'SYMROOT': '<(DEPTH)/xcodebuild',
217       'USE_HEADERMAP': 'NO',
218       'OTHER_CFLAGS': [
219         '-fno-strict-aliasing',
220       ],
221       'WARNING_CFLAGS': [
222         '-Wall',
223         '-Wendif-labels',
224         '-W',
225         '-Wno-unused-parameter',
226       ],
227     },
228   },
229   'conditions': [
230     ['component=="shared_library"', {
231       'cflags': [
232         '-fPIC',
233       ],
234     }],
235     ['OS=="win"', {
236       'target_defaults': {
237         'defines': [
238           'NOMINMAX',
239           '_CRT_SECURE_NO_DEPRECATE',
240           '_CRT_NONSTDC_NO_DEPRECATE',
241         ],
242         'conditions': [
243           ['component=="static_library"', {
244             'defines': [
245               '_HAS_EXCEPTIONS=0',
246             ],
247           }],
248         ],
249       },
250     }],  # OS=="win"
251     ['OS=="mac"', {
252       'target_defaults': {
253         'target_conditions': [
254           ['_type!="static_library"', {
255             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
256           }],
257         ],  # target_conditions
258       },  # target_defaults
259     }],  # OS=="mac"
260   ],
261   'xcode_settings': {
262     # See comment in Chromium's common.gypi for why this is needed.
263     'SYMROOT': '<(DEPTH)/xcodebuild',
264   }
265 }