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.
5 # Definitions to be used when building stand-alone PDFium binaries.
9 'component%': 'static_library',
11 'msvs_multi_core_compile%': '1',
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
22 '<!(uname -m | sed -e "s/i.86/ia32/;\
29 # OS!="linux" and OS!="mac"
34 'host_arch%': '<(host_arch)',
35 'target_arch%': '<(host_arch)',
37 'host_arch%': '<(host_arch)',
38 'target_arch%': '<(target_arch)',
40 # These two are needed by V8.
41 'host_arch%': '<(host_arch)',
42 'target_arch%': '<(target_arch)',
44 'v8_optimized_debug%': 0,
45 'v8_use_external_startup_data%': 0,
46 'icu_gyp_path': '../v8/third_party/icu/icu.gyp',
56 'default_configuration': 'Debug',
63 '-ffunction-sections',
69 ['component=="shared_library"', {
70 'RuntimeLibrary': '3', # /MDd
72 'RuntimeLibrary': '1', # /MTd
77 'LinkIncremental': '2',
81 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
86 '-fno-strict-aliasing',
89 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
90 'GCC_STRICT_ALIASING': 'NO',
95 'InlineFunctionExpansion': '2',
96 'EnableIntrinsicFunctions': 'true',
97 'FavorSizeOrSpeed': '0',
98 'StringPooling': 'true',
100 ['component=="shared_library"', {
101 'RuntimeLibrary': '2', #/MD
103 'RuntimeLibrary': '0', #/MT
108 'LinkIncremental': '1',
109 'OptimizeReferences': '2',
110 'EnableCOMDATFolding': '2',
117 '-ffunction-sections',
129 '-ffunction-sections',
136 'inherit_from': ['Debug'],
137 'msvs_configuration_platform': 'x64',
140 'inherit_from': ['Release'],
141 'msvs_configuration_platform': 'x64',
147 '-Wno-missing-field-initializers',
148 # Code might someday be made clean for -Wsign-compare, but for now
149 # this produces too much noise to be useful.
151 '-Wno-unused-parameter',
154 '-fvisibility=hidden',
158 '-Wnon-virtual-dtor',
165 # Don't use deprecated V8 APIs anywhere.
166 'V8_DEPRECATION_WARNINGS',
168 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
169 'msvs_configuration_attributes': {
170 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
171 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
174 'msvs_disabled_warnings': [4800, 4996, 4456, 4457, 4458, 4459, 4091],
175 # 4456, 4457, 4458, 4459 are variable shadowing warnings that are new in
177 # C4091: 'typedef ': ignored on left of 'X' when no variable is
179 # This happens in a number of Windows headers with VS 2015.
181 'VCCLCompilerTool': {
182 'MinimalRebuild': 'false',
183 'BufferSecurityCheck': 'true',
184 'EnableFunctionLevelLinking': 'true',
185 'RuntimeTypeInfo': 'false',
187 'DebugInformationFormat': '3',
188 'Detect64BitPortabilityProblems': 'false',
190 [ 'msvs_multi_core_compile', {
191 'AdditionalOptions': ['/MP'],
193 ['component=="shared_library"', {
194 'ExceptionHandling': '1', # /EHsc
196 'ExceptionHandling': '0',
198 ['target_arch=="x64"', {
199 # 64-bit warnings need to be resolved.
200 # https://code.google.com/p/pdfium/issues/detail?id=101
201 'WarnAsError': 'false',
203 'WarnAsError': 'true',
208 'AdditionalOptions': ['/ignore:4221'],
211 'GenerateDebugInformation': 'true',
212 'LinkIncremental': '1',
215 # 1 == /SUBSYSTEM:CONSOLE
216 # 2 == /SUBSYSTEM:WINDOWS
221 'ALWAYS_SEARCH_USER_PATHS': 'NO',
222 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11',
223 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
224 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
225 # (Equivalent to -fPIC)
226 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
227 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
228 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
229 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
230 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
231 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
232 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
233 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
234 'SYMROOT': '<(DEPTH)/xcodebuild',
235 'USE_HEADERMAP': 'NO',
237 '-fno-strict-aliasing',
243 '-Wno-unused-parameter',
248 ['component=="shared_library"', {
257 '_CRT_SECURE_NO_DEPRECATE',
258 '_CRT_NONSTDC_NO_DEPRECATE',
261 ['component=="static_library"', {
271 'target_conditions': [
272 ['_type!="static_library"', {
273 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
275 ], # target_conditions
278 ['v8_use_external_startup_data==1', {
281 'V8_USE_EXTERNAL_STARTUP_DATA',
284 }], # v8_use_external_startup_data==1
287 # See comment in Chromium's common.gypi for why this is needed.
288 'SYMROOT': '<(DEPTH)/xcodebuild',