aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHao Chen <chenhaosjtuacm@google.com>2020-02-04 23:32:17 -0800
committerHao Chen <chenhaosjtuacm@google.com>2020-02-05 15:47:51 -0800
commita0d2dfe49b9846fd27d457cd760402dcc9b16888 (patch)
tree24f9b75cd9551cea9b668b14be2688852cbd9ec7 /src
parent7a345e6d565f8718380f8ed554af67711ccbe02e (diff)
downloadprotobuf-a0d2dfe49b9846fd27d457cd760402dcc9b16888.tar.gz
CMakeLists for Cross-compiling
Bug: b/148877100 Test: verified successful cross compilation Change-Id: Ife96babf276f47aed46efdd330777552c444e5eb
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/port_def.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 57a2209e0..df08f7957 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -297,9 +297,18 @@
// ANDROID: autotdetect RTTI. Managing RTTI through command line -D
// parameters is hard across modules, just autodetect it.
#undef GOOGLE_PROTOBUF_NO_RTTI
+
+#if defined(__clang__)
#if !__has_feature(cxx_rtti)
#define GOOGLE_PROTOBUF_NO_RTTI 1
#endif
+#elif defined(__GNUC__)
+#if !defined(__GXX_RTTI)
+#define GOOGLE_PROTOBUF_NO_RTTI 1
+#endif
+#else
+#define GOOGLE_PROTOBUF_NO_RTTI 1
+#endif
#if defined(GOOGLE_PROTOBUF_NO_RTTI) && GOOGLE_PROTOBUF_NO_RTTI
#define PROTOBUF_RTTI 0