summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_gyp/standalone.gypi51
-rw-r--r--pdfium.gyp11
-rw-r--r--third_party/third_party.gyp9
-rw-r--r--xfa.gyp8
4 files changed, 54 insertions, 25 deletions
diff --git a/build_gyp/standalone.gypi b/build_gyp/standalone.gypi
index be18b5006c..f191c28e42 100644
--- a/build_gyp/standalone.gypi
+++ b/build_gyp/standalone.gypi
@@ -7,6 +7,7 @@
{
'variables': {
'component%': 'static_library',
+ 'chromium_code%': 0,
'clang%': 0,
'asan%': 0,
'sanitizer_coverage%': 0,
@@ -172,11 +173,9 @@
'cflags': [
'-Wall',
'-Werror',
- '-W',
+ '-Wextra',
+ # Two common warning flags for Clang and GCC.
'-Wno-missing-field-initializers',
- # Code might someday be made clean for -Wsign-compare, but for now
- # this produces too much noise to be useful.
- '-Wno-sign-compare',
'-Wno-unused-parameter',
'-pthread',
'-fno-exceptions',
@@ -360,6 +359,7 @@
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
+ 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
@@ -371,6 +371,7 @@
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
+ 'MACOSX_DEPLOYMENT_TARGET': '10.7', # -mmacosx-version-min
'SYMROOT': '<(DEPTH)/xcodebuild',
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
@@ -378,12 +379,13 @@
],
'WARNING_CFLAGS': [
'-Wall',
- '-Wendif-labels',
- '-W',
+ '-Werror',
+ '-Wextra',
'-Wno-unused-parameter',
],
},
'variables': {
+ 'chromium_code%': '<(chromium_code)',
'clang_warning_flags': [
# TODO(thakis): https://crbug.com/604888
'-Wno-undefined-var-template',
@@ -469,6 +471,43 @@
'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
}],
],
+ 'target_conditions': [
+ ['chromium_code==0', {
+ 'variables': {
+ 'clang_warning_flags': [
+ # Suppress unused variable warnings from third-party libraries.
+ '-Wno-unused-variable',
+ ],
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WarningLevel': '3',
+ },
+ },
+ 'conditions': [
+ ['OS!="win"', {
+ # Remove -Wextra for third-party code.
+ 'cflags!': [ '-Wextra' ],
+ }],
+ ['OS!="win" and clang==0', {
+ 'cflags!': [
+ '-Wall',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': ['-Wextra'],
+ },
+ }],
+ ],
+ }, { # chromium_code==1
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WarningLevel': '4',
+ },
+ },
+ }],
+ ], # target_conditions for 'target_defaults'
},
'conditions': [
['OS=="linux" or OS=="mac"', {
diff --git a/pdfium.gyp b/pdfium.gyp
index 5532bc8360..310fec5bf4 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -4,8 +4,7 @@
{
'variables': {
- # TODO(thakis): Enable this, pdfium:29
- #'chromium_code': 1,
+ 'chromium_code': 1,
'variables': {
'clang_use_pdfium_plugins%': 0,
@@ -95,14 +94,6 @@
'msvs_disabled_warnings': [
4267,
],
- 'variables': {
- 'clang_warning_flags': [
- # TODO(thestig): Fix all instances, remove this, pdfium:29
- '-Wno-sign-compare',
- ],
- # Make sure Chromium's build/common.gypi doesn't re-add the flag on linux.
- 'cflags_cc!': [ '-Wsign-compare' ],
- },
},
'targets': [
{
diff --git a/third_party/third_party.gyp b/third_party/third_party.gyp
index 2e03b59656..41db3b28db 100644
--- a/third_party/third_party.gyp
+++ b/third_party/third_party.gyp
@@ -85,6 +85,13 @@
'freetype/src/base/fttype1.c',
],
}],
+ ['os_posix==1 and clang==0', {
+ 'cflags': [
+ # open_face_PS_from_sfnt_stream() and open_face_from_buffer() in
+ # ftbase.h are unused. GCC needs this flag too.
+ '-Wno-unused-function',
+ ],
+ }],
],
'variables': {
'clang_warning_flags': [
@@ -122,7 +129,7 @@
'conditions': [
['os_posix==1', {
# library contains several enum vs non-enum conditionals.
- 'cflags': [ '-Wno-extra', ],
+ 'cflags': [ '-Wno-extra' ],
}],
],
'variables': {
diff --git a/xfa.gyp b/xfa.gyp
index 32b4b69501..f6293d5774 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -11,14 +11,6 @@
# TODO(thestig): Fix all instances, remove this, pdfium:29
4245, 4310, 4389, 4701, 4702, 4706, 4800,
],
- 'variables': {
- 'clang_warning_flags': [
- # TODO(thestig): Fix all instances, remove this, pdfium:29
- '-Wno-sign-compare',
- ],
- # Make sure Chromium's build/common.gypi doesn't re-add the flag on linux.
- 'cflags_cc!': [ '-Wsign-compare' ],
- },
},
"targets":[
{