Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 # Definitions to be used when building stand-alone PDFium binaries. | |
| 6 | |
| 7 { | |
| 8 'variables': { | |
| 9 'component%': 'static_library', | |
| 10 'clang%': 0, | |
| 11 'visibility%': 'hidden', | |
|
Nico
2014/05/23 21:14:33
Do you need this? (The mac branch of this file alw
jam
2014/05/23 23:52:13
I had copied it from v8's file; removed.
| |
| 12 'msvs_multi_core_compile%': '1', | |
| 13 'variables': { | |
| 14 'variables': { | |
| 15 'variables': { | |
| 16 'conditions': [ | |
| 17 ['OS=="linux" or OS=="mac"', { | |
| 18 # This handles the Unix platforms we generally deal with. | |
| 19 # Anything else gets passed through, which probably won't work | |
| 20 # very well; such hosts should pass an explicit target_arch | |
| 21 # to gyp. | |
| 22 'host_arch%': | |
| 23 '<!(uname -m | sed -e "s/i.86/ia32/;\ | |
| 24 s/x86_64/x64/;\ | |
| 25 s/amd64/x64/;\ | |
| 26 s/arm.*/arm/;\ | |
| 27 s/aarch64/arm64/;\ | |
| 28 s/mips.*/mipsel/")', | |
| 29 }, { | |
| 30 # OS!="linux" and OS!="mac" | |
| 31 'host_arch%': 'ia32', | |
| 32 }], | |
| 33 ], | |
| 34 }, | |
| 35 'host_arch%': '<(host_arch)', | |
| 36 'target_arch%': '<(host_arch)', | |
| 37 }, | |
| 38 'host_arch%': '<(host_arch)', | |
| 39 'target_arch%': '<(target_arch)', | |
| 40 }, | |
| 41 'host_arch%': '<(host_arch)', | |
| 42 'target_arch%': '<(target_arch)', | |
| 43 'werror%': '-Werror', | |
| 44 'v8_optimized_debug%': 0, | |
| 45 'icu_gyp_path': '../v8/third_party/icu/icu.gyp', | |
| 46 'conditions': [ | |
| 47 ['OS == "win"', { | |
| 48 'os_posix%': 0, | |
| 49 }, { | |
| 50 'os_posix%': 1, | |
| 51 }], | |
| 52 ], | |
| 53 }, | |
| 54 'target_defaults': { | |
| 55 'default_configuration': 'Debug', | |
| 56 'configurations': { | |
| 57 'Debug': { | |
| 58 'cflags': [ '-g', '-O0' ], | |
| 59 'msvs_settings': { | |
| 60 'VCCLCompilerTool': { | |
| 61 'Optimization': '0', | |
| 62 'conditions': [ | |
| 63 ['component=="shared_library"', { | |
| 64 'RuntimeLibrary': '3', # /MDd | |
| 65 }, { | |
| 66 'RuntimeLibrary': '1', # /MTd | |
| 67 }], | |
| 68 ], | |
| 69 }, | |
| 70 'VCLinkerTool': { | |
| 71 'LinkIncremental': '2', | |
| 72 }, | |
| 73 }, | |
| 74 'conditions': [ | |
| 75 ['OS=="linux"', { | |
| 76 'cflags!': [ | |
| 77 '-O0', | |
| 78 '-O3', | |
| 79 '-O2', | |
| 80 '-O1', | |
| 81 '-Os', | |
|
Nico
2014/05/23 21:14:33
This looks strange. I'm guessing you don't need it
jam
2014/05/23 23:52:13
Done.
| |
| 82 ], | |
| 83 'cflags': [ | |
| 84 '-fdata-sections', | |
| 85 '-ffunction-sections', | |
|
Nico
2014/05/23 21:14:33
cflags is only used on linux anyway, so add these
jam
2014/05/23 23:52:13
Done.
| |
| 86 ], | |
| 87 }], | |
| 88 ['OS=="mac"', { | |
| 89 'xcode_settings': { | |
|
Nico
2014/05/23 21:14:33
xcode_settings is only used on mac anyways, move i
jam
2014/05/23 23:52:13
Done.
| |
| 90 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 | |
| 91 }, | |
| 92 }], | |
| 93 ], | |
| 94 }, | |
| 95 'Release': { | |
| 96 'conditions': [ | |
| 97 ['OS=="linux"', { | |
| 98 'cflags!': [ | |
|
Nico
2014/05/23 21:14:33
Not sure why this is needed, since nothing added -
jam
2014/05/23 23:52:13
Done.
| |
| 99 '-Os', | |
| 100 ], | |
| 101 'cflags': [ | |
| 102 '-fdata-sections', | |
| 103 '-ffunction-sections', | |
| 104 '-O3', | |
| 105 '-O2', | |
| 106 ], | |
| 107 }], | |
| 108 ['OS=="android"', { | |
| 109 'cflags!': [ | |
| 110 '-O3', | |
| 111 '-Os', | |
| 112 ], | |
| 113 'cflags': [ | |
| 114 '-fdata-sections', | |
| 115 '-ffunction-sections', | |
| 116 '-O2', | |
| 117 ], | |
| 118 }], | |
| 119 ['OS=="mac"', { | |
|
Nico
2014/05/23 21:14:33
Again, doesn't have to be in a conditional
jam
2014/05/23 23:52:13
Done.
| |
| 120 'xcode_settings': { | |
| 121 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 | |
| 122 | |
| 123 # -fstrict-aliasing. Mainline gcc | |
| 124 # enables this at -O2 and above, | |
| 125 # but Apple gcc does not unless it | |
| 126 # is specified explicitly. | |
|
Nico
2014/05/23 21:14:33
This is no longer true, -fstrict-aliasing is now o
jam
2014/05/23 23:52:13
Done.
| |
| 127 'GCC_STRICT_ALIASING': 'YES', | |
| 128 }, | |
| 129 }], # OS=="mac" | |
| 130 ['OS=="win"', { | |
| 131 'msvs_settings': { | |
|
Nico
2014/05/23 21:14:33
msvs_settings is only used on windows, so no need
jam
2014/05/23 23:52:13
Done.
| |
| 132 'VCCLCompilerTool': { | |
| 133 'Optimization': '2', | |
| 134 'InlineFunctionExpansion': '2', | |
| 135 'EnableIntrinsicFunctions': 'true', | |
| 136 'FavorSizeOrSpeed': '0', | |
| 137 'StringPooling': 'true', | |
| 138 'conditions': [ | |
| 139 ['component=="shared_library"', { | |
| 140 'RuntimeLibrary': '2', #/MD | |
| 141 }, { | |
| 142 'RuntimeLibrary': '0', #/MT | |
| 143 }], | |
| 144 ], | |
| 145 }, | |
| 146 'VCLinkerTool': { | |
| 147 'LinkIncremental': '1', | |
| 148 'OptimizeReferences': '2', | |
| 149 'EnableCOMDATFolding': '2', | |
| 150 }, | |
| 151 }, | |
| 152 }], # OS=="win" | |
| 153 ], # conditions | |
| 154 }, | |
| 155 }, | |
| 156 'defines!': [ | |
| 157 'DEBUG', | |
| 158 ], | |
| 159 'conditions': [ | |
| 160 ['os_posix == 1 and OS != "mac"', { | |
|
Nico
2014/05/23 21:14:33
cflags isn't used on mac, no need to check for OS!
jam
2014/05/23 23:52:13
Done.
| |
| 161 'cflags!': [ | |
| 162 '-Werror', | |
| 163 ], | |
| 164 }], | |
| 165 ['OS == "mac"', { | |
|
Nico
2014/05/23 21:14:33
check unneeded
jam
2014/05/23 23:52:13
Done.
| |
| 166 'xcode_settings': { | |
| 167 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror | |
| 168 }, | |
| 169 }], | |
| 170 ['OS == "win"', { | |
|
Nico
2014/05/23 21:14:33
check unneeded
jam
2014/05/23 23:52:13
Done.
| |
| 171 'msvs_settings': { | |
| 172 'VCCLCompilerTool': { | |
| 173 'WarnAsError': 'false', | |
| 174 }, | |
| 175 }, | |
| 176 'msvs_configuration_attributes': { | |
| 177 'OutputDirectory': '<(DEPTH)\\out\\$(ConfigurationName)', | |
| 178 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', | |
| 179 'CharacterSet': '1', | |
| 180 }, | |
| 181 }], | |
| 182 ], | |
| 183 }, | |
| 184 'conditions': [ | |
| 185 ['OS=="linux"', { | |
|
Nico
2014/05/23 21:14:33
you probably want all that on android too? in that
jam
2014/05/23 23:52:13
Done.
| |
| 186 'target_defaults': { | |
| 187 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', | |
| 188 '-pthread', '-fno-exceptions'], | |
| 189 'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti' ], | |
| 190 'ldflags': [ '-pthread', ], | |
| 191 'conditions': [ | |
| 192 [ 'visibility=="hidden"', { | |
| 193 'cflags': [ '-fvisibility=hidden' ], | |
| 194 }], | |
| 195 [ 'component=="shared_library"', { | |
| 196 'cflags': [ '-fPIC', ], | |
| 197 }], | |
| 198 ], | |
| 199 }, | |
| 200 }], | |
| 201 ['OS=="win"', { | |
|
Nico
2014/05/23 21:14:33
conditional not needed
jam
2014/05/23 23:52:13
seems like defines that are windows specific don't
Nico
2014/05/24 23:14:23
Oh, you're right. Maybe move the msvs_foo out thou
jam
2014/05/27 01:46:21
well those ones won't impact other platforms right
| |
| 202 'target_defaults': { | |
| 203 'defines': [ | |
| 204 '_CRT_SECURE_NO_DEPRECATE', | |
| 205 '_CRT_NONSTDC_NO_DEPRECATE', | |
| 206 ], | |
| 207 'conditions': [ | |
| 208 ['component=="static_library"', { | |
| 209 'defines': [ | |
| 210 '_HAS_EXCEPTIONS=0', | |
| 211 ], | |
| 212 }], | |
| 213 ], | |
| 214 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'], | |
|
Nico
2014/05/23 21:14:33
hopefully not needed! :-)
jam
2014/05/23 23:52:13
unfortunately it is (i had found out the hard way
| |
| 215 'msvs_settings': { | |
| 216 'VCCLCompilerTool': { | |
| 217 'MinimalRebuild': 'false', | |
| 218 'BufferSecurityCheck': 'true', | |
| 219 'EnableFunctionLevelLinking': 'true', | |
| 220 'RuntimeTypeInfo': 'false', | |
| 221 'WarningLevel': '3', | |
| 222 'WarnAsError': 'true', | |
|
Nico
2014/05/23 21:14:33
Fine with me, but linux and mac check 'werror' for
jam
2014/05/23 23:52:13
this is copied from v8 and chrome's gypis, so sinc
| |
| 223 'DebugInformationFormat': '3', | |
| 224 'Detect64BitPortabilityProblems': 'false', | |
| 225 'conditions': [ | |
| 226 [ 'msvs_multi_core_compile', { | |
| 227 'AdditionalOptions': ['/MP'], | |
| 228 }], | |
| 229 ['component=="shared_library"', { | |
| 230 'ExceptionHandling': '1', # /EHsc | |
| 231 }, { | |
| 232 'ExceptionHandling': '0', | |
| 233 }], | |
| 234 ], | |
| 235 }, | |
| 236 'VCLibrarianTool': { | |
| 237 'AdditionalOptions': ['/ignore:4221'], | |
| 238 }, | |
| 239 'VCLinkerTool': { | |
| 240 'GenerateDebugInformation': 'true', | |
| 241 'LinkIncremental': '1', | |
| 242 # SubSystem values: | |
| 243 # 0 == not set | |
| 244 # 1 == /SUBSYSTEM:CONSOLE | |
| 245 # 2 == /SUBSYSTEM:WINDOWS | |
| 246 'SubSystem': '1', | |
| 247 'AdditionalDependencies': [ | |
| 248 'advapi32.lib', | |
| 249 'gdi32.lib', | |
| 250 'user32.lib', | |
| 251 ], | |
| 252 }, | |
| 253 }, | |
| 254 }, | |
| 255 }], # OS=="win" | |
| 256 ['OS=="mac"', { | |
| 257 'xcode_settings': { | |
| 258 'SYMROOT': '<(DEPTH)/xcodebuild', | |
| 259 }, | |
| 260 'target_defaults': { | |
| 261 'xcode_settings': { | |
| 262 'ALWAYS_SEARCH_USER_PATHS': 'NO', | |
| 263 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks | |
| 264 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic | |
| 265 # (Equivalent to -fPIC) | |
| 266 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions | |
| 267 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti | |
| 268 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings | |
| 269 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden | |
| 270 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', | |
| 271 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden | |
| 272 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics | |
|
Nico
2014/05/23 21:14:33
Do you want this? I think msvs's statics are threa
jam
2014/05/23 23:52:13
Done.
| |
| 273 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor | |
| 274 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min | |
|
Nico
2014/05/23 21:14:33
Remove comment, the thing it refers to isn't here
jam
2014/05/23 23:52:13
Done.
| |
| 275 'PREBINDING': 'NO', # No -Wl,-prebind | |
|
Nico
2014/05/23 21:14:33
You can probably remove this, current toolchains d
jam
2014/05/23 23:52:13
Done.
| |
| 276 'SYMROOT': '<(DEPTH)/xcodebuild', | |
| 277 'USE_HEADERMAP': 'NO', | |
| 278 'OTHER_CFLAGS': [ | |
| 279 '-fno-strict-aliasing', | |
| 280 ], | |
| 281 'WARNING_CFLAGS': [ | |
| 282 '-Wall', | |
| 283 '-Wendif-labels', | |
| 284 '-W', | |
| 285 '-Wno-unused-parameter', | |
| 286 ], | |
| 287 }, | |
| 288 'link_settings': { | |
| 289 'libraries': [ | |
| 290 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', | |
| 291 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', | |
| 292 ], | |
| 293 }, | |
| 294 'conditions': [ | |
| 295 ['werror==""', { | |
| 296 'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'}, | |
| 297 }, { | |
| 298 'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'}, | |
| 299 }], | |
| 300 ], | |
| 301 'target_conditions': [ | |
| 302 ['_type!="static_library"', { | |
| 303 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, | |
| 304 }], | |
| 305 ], # target_conditions | |
| 306 }, # target_defaults | |
| 307 }], # OS=="mac" | |
| 308 ], | |
| 309 } | |
| OLD | NEW |