diff options
author | jshin@chromium.org <jshin@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2011-02-16 21:58:54 +0000 |
---|---|---|
committer | jshin@chromium.org <jshin@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2011-02-16 21:58:54 +0000 |
commit | 8ad988882c0a6bb2ac66eecab662141110840e66 (patch) | |
tree | 2c33c0c050ee8066e24a8e96b0ef1b5ee32c6ef5 /icu.gyp | |
parent | b63d73f8e51a048cb9c30a6facd7a02faf8edc2b (diff) | |
download | icu-8ad988882c0a6bb2ac66eecab662141110840e66.tar.gz |
Enable RTTI for ICU.
ICU 4.6 uses RTTI (dynamic_cast and typeid) in many places.
It'll increase the vtbl size. I'm gonna measure the size impact by
making two builds:
1. With rtti enabled
2. With rtti disabled, but with dynamic_cast replaced with
static_cast and typeid with 'something' buildable. This build wouldn't run
properly, but for the size comparision, just compiling it should be fine.
On Windows, we set _HAS_EXCEPTIONS to 0 in common.gypi. To build ICU
without enabling exception as well on Windows, we replaced the following line
#include <typeinfo>
with
#include "unicode/utypeinfo.h"
and add a new file 'common/unicode/utypeinfo.h' with the following:
#if defined(_MSC_VERSION) && _HAS_EXCEPTIONS == 0
#include <exception>
using std::exception;
#endif
#include <typeinfo>
BUG=61514
TEST=On all 3 platforms, Chrome can be built and can be run without crash.
Review URL: http://codereview.chromium.org/6484008
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu46@75186 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Diffstat (limited to 'icu.gyp')
-rw-r--r-- | icu.gyp | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -270,6 +270,21 @@ 'cflags': [ '-Wno-deprecated-declarations', ], + 'cflags_cc': [ + '-frtti', + ], + }], + ['OS == "mac"', { + 'xcode_settings': { + 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti + } + }], + ['OS == "win"', { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'true', + }, + } }], ], }, @@ -471,6 +486,21 @@ '-Wno-deprecated-declarations', '-Wno-unused-function', ], + 'cflags_cc': [ + '-frtti', + ], + }], + ['OS == "mac"', { + 'xcode_settings': { + 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti + } + }], + ['OS == "win"', { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'true', + }, + } }], ], }, |