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',
141 '-Wno-unused-parameter',
142 '-pthread', '-fno-exceptions',
143 '-fvisibility=hidden',
146 '-Wnon-virtual-dtor',
152 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
153 'msvs_configuration_attributes': {
154 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
155 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
159 'VCCLCompilerTool': {
160 'MinimalRebuild': 'false',
161 'BufferSecurityCheck': 'true',
162 'EnableFunctionLevelLinking': 'true',
163 'RuntimeTypeInfo': 'false',
165 'WarnAsError': 'false',
166 'DebugInformationFormat': '3',
167 'Detect64BitPortabilityProblems': 'false',
169 [ 'msvs_multi_core_compile', {
170 'AdditionalOptions': ['/MP'],
172 ['component=="shared_library"', {
173 'ExceptionHandling': '1', # /EHsc
175 'ExceptionHandling': '0',
180 'AdditionalOptions': ['/ignore:4221'],
183 'GenerateDebugInformation': 'true',
184 'LinkIncremental': '1',
187 # 1 == /SUBSYSTEM:CONSOLE
188 # 2 == /SUBSYSTEM:WINDOWS
193 'ALWAYS_SEARCH_USER_PATHS': 'NO',
194 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
195 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
196 # (Equivalent to -fPIC)
197 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
198 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
199 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
200 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
201 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
202 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
203 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
204 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
205 'SYMROOT': '<(DEPTH)/xcodebuild',
206 'USE_HEADERMAP': 'NO',
208 '-fno-strict-aliasing',
214 '-Wno-unused-parameter',
219 ['component=="shared_library"', {
228 '_CRT_SECURE_NO_DEPRECATE',
229 '_CRT_NONSTDC_NO_DEPRECATE',
232 ['component=="static_library"', {
242 'target_conditions': [
243 ['_type!="static_library"', {
244 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
246 ], # target_conditions
251 # See comment in Chromium's common.gypi for why this is needed.
252 'SYMROOT': '<(DEPTH)/xcodebuild',