Skip to content

Commit

Permalink
Switch from stlport to libcxx in Android build
Browse files Browse the repository at this point in the history
Deprecation of stlport is an important step to enable C++11 everywhere in Mozc.  With this CL, Mozc for Android will be built with libcxx by default, and building Mozc with stlport is not supported anymore.

Basically no user visible change is intended with this CL.

BUG=Issue mozc:219
TEST=compile

git-svn-id: https://mozc.googlecode.com/svn/trunk@505 a6090854-d499-a067-5803-1114d4e51264
  • Loading branch information
yukawa committed Jan 25, 2015
1 parent 9340de8 commit bf59692
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 39 deletions.
7 changes: 0 additions & 7 deletions src/base/hash_tables.h
Expand Up @@ -46,12 +46,6 @@ using stdext::hash_set;
#endif
#else // not OS_WIN

#ifdef MOZC_USE_STLPORT
// Use stlport hash_set/hash_map for android.
#include <hash_map>
#include <hash_set>
#else // not MOZC_USE_STLPORT

#include <ext/hash_map>
#include <ext/hash_set>
using __gnu_cxx::hash_map;
Expand All @@ -71,7 +65,6 @@ struct hash<std::string> {
}
};
}
#endif // not MOZC_USE_STLPORT
#endif // not OS_WIN

#endif // MOZC_BASE_HASH_TABLES_H_
7 changes: 2 additions & 5 deletions src/build_mozc.py
Expand Up @@ -389,8 +389,8 @@ def ParseGypOptions(args=None, values=None):
'(arm, x86, mips)')
parser.add_option('--android_stl', dest='android_stl',
type='choice',
choices=('stlport', 'gnustl', 'libcxx'),
default='stlport',
choices=('gnustl', 'libcxx'),
default='libcxx',
help='[Android build only] Standard C++ library')
parser.add_option('--android_compiler', dest='android_compiler',
type='choice',
Expand Down Expand Up @@ -760,9 +760,6 @@ def GypMain(options, unused_args, _):

gyp_options.extend(['-D', 'android_home=%s' % android_home])
gyp_options.extend(['-D', 'android_arch=%s' % options.android_arch])
if options.android_compiler == 'clang' and options.android_stl != 'libcxx':
raise ValueError(
'Only libc++ is supported with Clang. Use --android_stl=libcxx')
gyp_options.extend(['-D', 'android_stl=%s' % options.android_stl])
gyp_options.extend(['-D', 'android_compiler=%s' % options.android_compiler])
gyp_options.extend(['-D', 'android_ndk_home=%s' % android_ndk_home])
Expand Down
5 changes: 0 additions & 5 deletions src/gyp/common.gypi
Expand Up @@ -392,11 +392,6 @@
'-mthumb', # Force thumb interaction set for smaller file size.
],
}],
['android_stl=="stlport"', {
'defines': [
'MOZC_USE_STLPORT',
],
}],
],
}],
],
Expand Down
2 changes: 1 addition & 1 deletion src/mozc_version_template.txt
@@ -1,6 +1,6 @@
MAJOR=2
MINOR=16
BUILD=2031
BUILD=2032
REVISION=102
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
# downloaded by NaCl Mozc.
Expand Down
21 changes: 0 additions & 21 deletions src/protobuf/config.h
Expand Up @@ -32,25 +32,6 @@

#ifndef _WINDOWS

#ifdef MOZC_USE_STLPORT

/* the name of <hash_map> */
#define HASH_MAP_CLASS hash_map

/* the location of <unordered_map> or <hash_map> */
#define HASH_MAP_H <hash_map>

/* the namespace of hash_map/hash_set */
#define HASH_NAMESPACE std

/* the name of <hash_set> */
#define HASH_SET_CLASS hash_set

/* the location of <unordered_set> or <hash_set> */
#define HASH_SET_H <hash_set>

#else // MOZC_USE_STLPORT

/* the name of <hash_map> */
/* TODO(yukawa): use unordered_map if available */
#define HASH_MAP_CLASS hash_map
Expand All @@ -71,8 +52,6 @@
/* TODO(yukawa): use <tr1/unordered_set> or <unordered_set> if available */
#define HASH_SET_H <ext/hash_set>

#endif // MOZC_USE_STLPORT

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

Expand Down

0 comments on commit bf59692

Please sign in to comment.