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',
152 '-fvisibility=hidden',
156 '-Wnon-virtual-dtor',
162 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
163 'msvs_configuration_attributes': {
164 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
165 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
169 'VCCLCompilerTool': {
170 'MinimalRebuild': 'false',
171 'BufferSecurityCheck': 'true',
172 'EnableFunctionLevelLinking': 'true',
173 'RuntimeTypeInfo': 'false',
175 'WarnAsError': 'false',
176 'DebugInformationFormat': '3',
177 'Detect64BitPortabilityProblems': 'false',
179 [ 'msvs_multi_core_compile', {
180 'AdditionalOptions': ['/MP'],
182 ['component=="shared_library"', {
183 'ExceptionHandling': '1', # /EHsc
185 'ExceptionHandling': '0',
190 'AdditionalOptions': ['/ignore:4221'],
193 'GenerateDebugInformation': 'true',
194 'LinkIncremental': '1',
197 # 1 == /SUBSYSTEM:CONSOLE
198 # 2 == /SUBSYSTEM:WINDOWS
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',
219 '-fno-strict-aliasing',
225 '-Wno-unused-parameter',
230 ['component=="shared_library"', {
239 '_CRT_SECURE_NO_DEPRECATE',
240 '_CRT_NONSTDC_NO_DEPRECATE',
243 ['component=="static_library"', {
253 'target_conditions': [
254 ['_type!="static_library"', {
255 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
257 ], # target_conditions
262 # See comment in Chromium's common.gypi for why this is needed.
263 'SYMROOT': '<(DEPTH)/xcodebuild',