gn2bp: Convert `source_set` with rtti to static_libraries
* `source_set` were converted to cc_defaults and this would pose a huge problem if those cc_defaults had rtti on since it affected all of the dependencies of the source target.
* The solution here would be to compile the `source_set` independently as a static/shared library with rtti on then link it.
Test: m cronet_aml_components_cronet_android_cronet
Change-Id: I28bbe0947d0dc87c2d602514a2759a3171b68aa2
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 3d98ce6..70e4466 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -127,9 +127,6 @@
'cronet_aml_net_third_party_quiche_quiche',
'cronet_aml_crypto_crypto',
}),
- # When a code is compiled under rtti(cronet) that depends on another code(net)
- # that doesn't depend on rtti. undefined symbol: typeinfo 'class' errors appears.
- ('rtti', True), # go/undefined-symbol-typeinfo
],
}
@@ -967,8 +964,6 @@
for flag in cflags:
if '-std=' in flag:
module.cpp_std = flag[len('-std='):]
- if '-frtti' in flag:
- module.rtti = True
if '-fexceptions' in flag:
module.cppflags.add('-fexceptions')
@@ -1072,6 +1067,8 @@
for src in arch.sources
if is_supported_source_file(src) and not src.startswith("//out/test"))
+ module.rtti = target.rtti
+
if target.type in gn_utils.LINKER_UNIT_TYPES:
set_module_flags(module, target.cflags, target.defines)
set_module_include_dirs(module, target.cflags, target.include_dirs)