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 'icu_gyp_path': '../v8/third_party/icu/icu.gyp',
55 'default_configuration': 'Debug',
62 '-ffunction-sections',
68 ['component=="shared_library"', {
69 'RuntimeLibrary': '3', # /MDd
71 'RuntimeLibrary': '1', # /MTd
76 'LinkIncremental': '2',
80 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
85 '-fno-strict-aliasing',
88 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
89 'GCC_STRICT_ALIASING': 'NO',
94 'InlineFunctionExpansion': '2',
95 'EnableIntrinsicFunctions': 'true',
96 'FavorSizeOrSpeed': '0',
97 'StringPooling': 'true',
99 ['component=="shared_library"', {
100 'RuntimeLibrary': '2', #/MD
102 'RuntimeLibrary': '0', #/MT
107 'LinkIncremental': '1',
108 'OptimizeReferences': '2',
109 'EnableCOMDATFolding': '2',
116 '-ffunction-sections',
128 '-ffunction-sections',
135 'inherit_from': ['Debug'],
136 'msvs_configuration_platform': 'x64',
139 'inherit_from': ['Release'],
140 'msvs_configuration_platform': 'x64',
149 '-Wno-unused-parameter',
150 '-pthread', '-fno-exceptions',
151 '-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)',
167 'VCCLCompilerTool': {
168 'MinimalRebuild': 'false',
169 'BufferSecurityCheck': 'true',
170 'EnableFunctionLevelLinking': 'true',
171 'RuntimeTypeInfo': 'false',
173 'WarnAsError': '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',
188 'AdditionalOptions': ['/ignore:4221'],
191 'GenerateDebugInformation': 'true',
192 'LinkIncremental': '1',
195 # 1 == /SUBSYSTEM:CONSOLE
196 # 2 == /SUBSYSTEM:WINDOWS
201 'ALWAYS_SEARCH_USER_PATHS': 'NO',
202 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
203 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
204 # (Equivalent to -fPIC)
205 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
206 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
207 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
208 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
209 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
210 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
211 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
212 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
213 'SYMROOT': '<(DEPTH)/xcodebuild',
214 'USE_HEADERMAP': 'NO',
216 '-fno-strict-aliasing',
222 '-Wno-unused-parameter',
227 ['component=="shared_library"', {
236 '_CRT_SECURE_NO_DEPRECATE',
237 '_CRT_NONSTDC_NO_DEPRECATE',
240 ['component=="static_library"', {
250 'target_conditions': [
251 ['_type!="static_library"', {
252 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
254 ], # target_conditions
259 # See comment in Chromium's common.gypi for why this is needed.
260 'SYMROOT': '<(DEPTH)/xcodebuild',