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-unused-parameter',
150 '-fvisibility=hidden',
154 '-Wnon-virtual-dtor',
160 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
161 'msvs_configuration_attributes': {
162 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
163 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
166 'msvs_disabled_warnings': [4800, 4996],
168 'VCCLCompilerTool': {
169 'MinimalRebuild': 'false',
170 'BufferSecurityCheck': 'true',
171 'EnableFunctionLevelLinking': 'true',
172 'RuntimeTypeInfo': 'false',
174 'DebugInformationFormat': '3',
175 'Detect64BitPortabilityProblems': 'false',
177 [ 'msvs_multi_core_compile', {
178 'AdditionalOptions': ['/MP'],
180 ['component=="shared_library"', {
181 'ExceptionHandling': '1', # /EHsc
183 'ExceptionHandling': '0',
185 ['target_arch=="x64"', {
186 # 64-bit warnings need to be resolved.
187 # https://code.google.com/p/pdfium/issues/detail?id=101
188 'WarnAsError': 'false',
190 'WarnAsError': 'true',
195 'AdditionalOptions': ['/ignore:4221'],
198 'GenerateDebugInformation': 'true',
199 'LinkIncremental': '1',
202 # 1 == /SUBSYSTEM:CONSOLE
203 # 2 == /SUBSYSTEM:WINDOWS
208 'ALWAYS_SEARCH_USER_PATHS': 'NO',
209 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11',
210 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
211 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
212 # (Equivalent to -fPIC)
213 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
214 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
215 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
216 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
217 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
218 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
219 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
220 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
221 'SYMROOT': '<(DEPTH)/xcodebuild',
222 'USE_HEADERMAP': 'NO',
224 '-fno-strict-aliasing',
230 '-Wno-unused-parameter',
235 ['component=="shared_library"', {
244 '_CRT_SECURE_NO_DEPRECATE',
245 '_CRT_NONSTDC_NO_DEPRECATE',
248 ['component=="static_library"', {
258 'target_conditions': [
259 ['_type!="static_library"', {
260 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
262 ], # target_conditions
265 ['v8_use_external_startup_data==1', {
268 'V8_USE_EXTERNAL_STARTUP_DATA',
271 }], # v8_use_external_startup_data==1
274 # See comment in Chromium's common.gypi for why this is needed.
275 'SYMROOT': '<(DEPTH)/xcodebuild',