Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1426)

Unified Diff: build/standalone.gypi

Issue 298893007: Create a standalone pdfium build. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: fix mac Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/standalone.gypi
diff --git a/build/standalone.gypi b/build/standalone.gypi
new file mode 100644
index 0000000000000000000000000000000000000000..de4042bba2ec5dd50442ae84839b9563c71b7398
--- /dev/null
+++ b/build/standalone.gypi
@@ -0,0 +1,309 @@
+# Copyright 2014 PDFium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Definitions to be used when building stand-alone PDFium binaries.
+
+{
+ 'variables': {
+ 'component%': 'static_library',
+ 'clang%': 0,
+ '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.
+ 'msvs_multi_core_compile%': '1',
+ 'variables': {
+ 'variables': {
+ 'variables': {
+ 'conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ # This handles the Unix platforms we generally deal with.
+ # Anything else gets passed through, which probably won't work
+ # very well; such hosts should pass an explicit target_arch
+ # to gyp.
+ 'host_arch%':
+ '<!(uname -m | sed -e "s/i.86/ia32/;\
+ s/x86_64/x64/;\
+ s/amd64/x64/;\
+ s/arm.*/arm/;\
+ s/aarch64/arm64/;\
+ s/mips.*/mipsel/")',
+ }, {
+ # OS!="linux" and OS!="mac"
+ 'host_arch%': 'ia32',
+ }],
+ ],
+ },
+ 'host_arch%': '<(host_arch)',
+ 'target_arch%': '<(host_arch)',
+ },
+ 'host_arch%': '<(host_arch)',
+ 'target_arch%': '<(target_arch)',
+ },
+ 'host_arch%': '<(host_arch)',
+ 'target_arch%': '<(target_arch)',
+ 'werror%': '-Werror',
+ 'v8_optimized_debug%': 0,
+ 'icu_gyp_path': '../v8/third_party/icu/icu.gyp',
+ 'conditions': [
+ ['OS == "win"', {
+ 'os_posix%': 0,
+ }, {
+ 'os_posix%': 1,
+ }],
+ ],
+ },
+ 'target_defaults': {
+ 'default_configuration': 'Debug',
+ 'configurations': {
+ 'Debug': {
+ 'cflags': [ '-g', '-O0' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'Optimization': '0',
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '3', # /MDd
+ }, {
+ 'RuntimeLibrary': '1', # /MTd
+ }],
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkIncremental': '2',
+ },
+ },
+ 'conditions': [
+ ['OS=="linux"', {
+ 'cflags!': [
+ '-O0',
+ '-O3',
+ '-O2',
+ '-O1',
+ '-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.
+ ],
+ 'cflags': [
+ '-fdata-sections',
+ '-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.
+ ],
+ }],
+ ['OS=="mac"', {
+ '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.
+ 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
+ },
+ }],
+ ],
+ },
+ 'Release': {
+ 'conditions': [
+ ['OS=="linux"', {
+ '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.
+ '-Os',
+ ],
+ 'cflags': [
+ '-fdata-sections',
+ '-ffunction-sections',
+ '-O3',
+ '-O2',
+ ],
+ }],
+ ['OS=="android"', {
+ 'cflags!': [
+ '-O3',
+ '-Os',
+ ],
+ 'cflags': [
+ '-fdata-sections',
+ '-ffunction-sections',
+ '-O2',
+ ],
+ }],
+ ['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.
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
+
+ # -fstrict-aliasing. Mainline gcc
+ # enables this at -O2 and above,
+ # but Apple gcc does not unless it
+ # 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.
+ 'GCC_STRICT_ALIASING': 'YES',
+ },
+ }], # OS=="mac"
+ ['OS=="win"', {
+ '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.
+ 'VCCLCompilerTool': {
+ 'Optimization': '2',
+ 'InlineFunctionExpansion': '2',
+ 'EnableIntrinsicFunctions': 'true',
+ 'FavorSizeOrSpeed': '0',
+ 'StringPooling': 'true',
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '2', #/MD
+ }, {
+ 'RuntimeLibrary': '0', #/MT
+ }],
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkIncremental': '1',
+ 'OptimizeReferences': '2',
+ 'EnableCOMDATFolding': '2',
+ },
+ },
+ }], # OS=="win"
+ ], # conditions
+ },
+ },
+ 'defines!': [
+ 'DEBUG',
+ ],
+ 'conditions': [
+ ['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.
+ 'cflags!': [
+ '-Werror',
+ ],
+ }],
+ ['OS == "mac"', {
Nico 2014/05/23 21:14:33 check unneeded
jam 2014/05/23 23:52:13 Done.
+ 'xcode_settings': {
+ 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
+ },
+ }],
+ ['OS == "win"', {
Nico 2014/05/23 21:14:33 check unneeded
jam 2014/05/23 23:52:13 Done.
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WarnAsError': 'false',
+ },
+ },
+ 'msvs_configuration_attributes': {
+ 'OutputDirectory': '<(DEPTH)\\out\\$(ConfigurationName)',
+ 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
+ 'CharacterSet': '1',
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['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.
+ 'target_defaults': {
+ 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
+ '-pthread', '-fno-exceptions'],
+ 'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti' ],
+ 'ldflags': [ '-pthread', ],
+ 'conditions': [
+ [ 'visibility=="hidden"', {
+ 'cflags': [ '-fvisibility=hidden' ],
+ }],
+ [ 'component=="shared_library"', {
+ 'cflags': [ '-fPIC', ],
+ }],
+ ],
+ },
+ }],
+ ['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
+ 'target_defaults': {
+ 'defines': [
+ '_CRT_SECURE_NO_DEPRECATE',
+ '_CRT_NONSTDC_NO_DEPRECATE',
+ ],
+ 'conditions': [
+ ['component=="static_library"', {
+ 'defines': [
+ '_HAS_EXCEPTIONS=0',
+ ],
+ }],
+ ],
+ '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
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'MinimalRebuild': 'false',
+ 'BufferSecurityCheck': 'true',
+ 'EnableFunctionLevelLinking': 'true',
+ 'RuntimeTypeInfo': 'false',
+ 'WarningLevel': '3',
+ '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
+ 'DebugInformationFormat': '3',
+ 'Detect64BitPortabilityProblems': 'false',
+ 'conditions': [
+ [ 'msvs_multi_core_compile', {
+ 'AdditionalOptions': ['/MP'],
+ }],
+ ['component=="shared_library"', {
+ 'ExceptionHandling': '1', # /EHsc
+ }, {
+ 'ExceptionHandling': '0',
+ }],
+ ],
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': ['/ignore:4221'],
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ # SubSystem values:
+ # 0 == not set
+ # 1 == /SUBSYSTEM:CONSOLE
+ # 2 == /SUBSYSTEM:WINDOWS
+ 'SubSystem': '1',
+ 'AdditionalDependencies': [
+ 'advapi32.lib',
+ 'gdi32.lib',
+ 'user32.lib',
+ ],
+ },
+ },
+ },
+ }], # OS=="win"
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ },
+ 'target_defaults': {
+ 'xcode_settings': {
+ 'ALWAYS_SEARCH_USER_PATHS': 'NO',
+ 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
+ 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
+ # (Equivalent to -fPIC)
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
+ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
+ 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
+ # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
+ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
+ '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.
+ 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
+ # 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.
+ '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.
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ 'USE_HEADERMAP': 'NO',
+ 'OTHER_CFLAGS': [
+ '-fno-strict-aliasing',
+ ],
+ 'WARNING_CFLAGS': [
+ '-Wall',
+ '-Wendif-labels',
+ '-W',
+ '-Wno-unused-parameter',
+ ],
+ },
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+ ],
+ },
+ 'conditions': [
+ ['werror==""', {
+ 'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'},
+ }, {
+ 'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'},
+ }],
+ ],
+ 'target_conditions': [
+ ['_type!="static_library"', {
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
+ }],
+ ], # target_conditions
+ }, # target_defaults
+ }], # OS=="mac"
+ ],
+}

Powered by Google App Engine
This is Rietveld 408576698