From 0ae344e5cd7e8d4fc66524ec6b0ca9199440d4ca Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 4 Jul 2016 16:40:46 +0900 Subject: [PATCH] Fix building on Linux --- brightray/brightray.gypi | 68 +++++++++++++++---------- brightray/browser/browser_main_parts.cc | 3 +- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 2800409124d2..038348fe6c53 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -35,15 +35,6 @@ 'MACOSX_DEPLOYMENT_TARGET': '10.8', 'RUN_CLANG_STATIC_ANALYZER': 'YES', 'USE_HEADER_MAP': 'NO', - 'WARNING_CFLAGS': [ - '-Wall', - '-Wextra', - '-Wno-unused-parameter', - '-Wno-missing-field-initializers', - '-Wno-deprecated-declarations', - '-Wno-unneeded-internal-declaration', - '-Wno-inconsistent-missing-override', - ], }, 'msvs_configuration_attributes': { 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', @@ -92,24 +83,6 @@ ], }, }, - 'msvs_disabled_warnings': [ - 4100, # unreferenced formal parameter - 4121, # alignment of a member was sensitive to packing - 4127, # conditional expression is constant - 4189, # local variable is initialized but not referenced - 4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data - 4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch - 4251, # class 'std::xx' needs to have dll-interface. - 4310, # cast truncates constant value - 4355, # 'this' : used in base member initializer list - 4480, # nonstandard extension used: specifying underlying type for enum - 4481, # nonstandard extension used: override specifier 'override' - 4510, # default constructor could not be generated - 4512, # assignment operator could not be generated - 4610, # user defined constructor required - 4702, # unreachable code - 4819, # The file contains a character that cannot be represented in the current code page - ], 'configurations': { # The "Debug" and "Release" configurations are not actually used. 'Debug': {}, @@ -342,5 +315,46 @@ ], }], ], # target_conditions + # Ignored compiler warnings of Chromium. + 'conditions': [ + ['OS=="mac"', { + 'xcode_settings': { + 'WARNING_CFLAGS': [ + '-Wall', + '-Wextra', + '-Wno-unused-parameter', + '-Wno-missing-field-initializers', + '-Wno-deprecated-declarations', + '-Wno-unneeded-internal-declaration', + '-Wno-inconsistent-missing-override', + ], + }, + }], + ['OS=="linux"', { + 'cflags': [ + '-Wno-inconsistent-missing-override', + ], + }], + ['OS=="win"', { + 'msvs_disabled_warnings': [ + 4100, # unreferenced formal parameter + 4121, # alignment of a member was sensitive to packing + 4127, # conditional expression is constant + 4189, # local variable is initialized but not referenced + 4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data + 4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch + 4251, # class 'std::xx' needs to have dll-interface. + 4310, # cast truncates constant value + 4355, # 'this' : used in base member initializer list + 4480, # nonstandard extension used: specifying underlying type for enum + 4481, # nonstandard extension used: override specifier 'override' + 4510, # default constructor could not be generated + 4512, # assignment operator could not be generated + 4610, # user defined constructor required + 4702, # unreachable code + 4819, # The file contains a character that cannot be represented in the current code page + ], + }], + ], # conditions }, # target_defaults } diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 9f0ef0245dbd..c2127b3b5aa6 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -21,6 +21,7 @@ #include "ui/base/l10n/l10n_util.h" #if defined(USE_AURA) +#include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/views/widget/desktop_aura/desktop_screen.h" #endif @@ -33,7 +34,7 @@ #include "base/environment.h" #include "base/path_service.h" #include "base/nix/xdg_util.h" -#include "base/thread_task_runner_handle.h" +#include "base/threading/thread_task_runner_handle.h" #include "browser/brightray_paths.h" #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" #include "ui/base/x/x11_util.h"