From 8cb68c4fbd51eaf9ea6700d2e9da71755132c8b1 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Thu, 27 Jun 2013 15:51:43 +0200 Subject: Mac: Use libc++ instead of stdlibc++. - Add a missing include file to process_iterator_mac.cc. - Disable Chromium clang plugins. - Add a use_libcpp variable to common.gypi that can be used to build with libc++ instead of libstdc++. In this case several warnings also must be disabled. - ext/hash_map and ext/hash_set are deprecated. Use unordered containers as a replacement. Change-Id: Ief9e8901d0463f2bb62a5960cde03543b3999be1 Reviewed-by: Zeno Albisser --- chromium/base/process/process_iterator_mac.cc | 1 + chromium/build/common.gypi | 31 +++++++++++++++++++++++++-- chromium/third_party/protobuf/config.h | 27 ++++++++++++----------- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/chromium/base/process/process_iterator_mac.cc b/chromium/base/process/process_iterator_mac.cc index 29daa2d489f..e35c2ae19ba 100644 --- a/chromium/base/process/process_iterator_mac.cc +++ b/chromium/base/process/process_iterator_mac.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include "base/logging.h" #include "base/strings/string_util.h" diff --git a/chromium/build/common.gypi b/chromium/build/common.gypi index d7b385cc0ee..e995bd644eb 100644 --- a/chromium/build/common.gypi +++ b/chromium/build/common.gypi @@ -1232,6 +1232,9 @@ # rlz codes for searches but do not use the library. 'enable_rlz%': 0, + # Compile with libc++ instead of libstdc++. + 'use_libcpp%' : 0, + # Turns on the i18n support in V8. 'v8_enable_i18n_support': 1, @@ -2134,6 +2137,18 @@ ['use_clipboard_aurax11==1', { 'defines': ['USE_CLIPBOARD_AURAX11=1'], }], + ['use_libcpp==1', { + 'defines': ['USE_UNORDERED_CONTAINERS=1'], + 'cflags_cc': [ + '-Wno-deprecated-declarations', + '-Wno-newline-eof', + '-Wno-unused-value', + '-Wno-unused-variable', + '-Wno-unused-function', + '-Wno-header-hygiene', + '-stdlib=libc++' + ], + }], ['enable_one_click_signin==1', { 'defines': ['ENABLE_ONE_CLICK_SIGNIN'], }], @@ -3335,7 +3350,7 @@ # Clang considers the `register` keyword as deprecated, but e.g. # code generated by flex (used in angle) contains that keyword. # http://crbug.com/255186 - '-Wno-deprecated-register', + '-Wno-deprecated', ], 'cflags!': [ # Clang doesn't seem to know know this flag. @@ -4043,7 +4058,19 @@ # Clang considers the `register` keyword as deprecated, but e.g. # code generated by flex (used in angle) contains that keyword. # http://crbug.com/255186 - '-Wno-deprecated-register', + '-Wno-deprecated', + ], + }], + ['use_libcpp==1', { + 'OTHER_CPLUSPLUSFLAGS': ['-stdlib=libc++'], + 'USE_LIBCPP': 'YES', + 'WARNING_CFLAGS': [ + '-Wno-deprecated-declarations', + '-Wno-newline-eof', + '-Wno-unused-value', + '-Wno-unused-variable', + '-Wno-unused-function', + '-Wno-header-hygiene', ], }], ['clang==1 and clang_use_chrome_plugins==1', { diff --git a/chromium/third_party/protobuf/config.h b/chromium/third_party/protobuf/config.h index dcc0041c2fe..affcf55be5f 100644 --- a/chromium/third_party/protobuf/config.h +++ b/chromium/third_party/protobuf/config.h @@ -1,31 +1,32 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ -/* the name of */ -#define HASH_MAP_CLASS hash_map +#if defined(USE_UNORDERED_CONTAINERS) + +#define HASH_MAP_H +#define HASH_SET_H +#define HASH_NAMESPACE std +#define HASH_MAP_CLASS unordered_map +#define HASH_SET_CLASS unordered_set -/* the location of */ -#if defined(USE_STLPORT) -#define HASH_MAP_H #else -#define HASH_MAP_H -#endif -/* the namespace of hash_map/hash_set */ #if defined(USE_STLPORT) +#define HASH_MAP_H +#define HASH_SET_H #define HASH_NAMESPACE std #else +#define HASH_MAP_H +#define HASH_SET_H #define HASH_NAMESPACE __gnu_cxx #endif +/* the name of */ +#define HASH_MAP_CLASS hash_map + /* the name of */ #define HASH_SET_CLASS hash_set -/* the location of */ -#if defined(USE_STLPORT) -#define HASH_SET_H -#else -#define HASH_SET_H #endif /* Define to 1 if you have the header file. */ -- cgit v1.2.1