55import (" $flutter_root /common/config.gni" )
66
77config (" libcxxabi_config" ) {
8- common_cc_flags = [ " -nostdinc++" ]
9-
10- cflags_cc = common_cc_flags
11- cflags_objcc = common_cc_flags
12-
138 include_dirs = [ " include" ]
149}
1510
1611source_set (" libcxxabi" ) {
1712 visibility = [ " ../libcxx:*" ]
1813
19- public_configs = [ " :libcxxabi_config" ]
20-
21- defines = [
22- " _LIBCXXABI_NO_EXCEPTIONS" ,
23- " _LIBCXXABI_BUILDING_LIBRARY" ,
24- " LIBCXXABI_SILENT_TERMINATE" ,
25- ]
26-
27- sources = []
28-
29- # Compile libcxx ABI using C++11. This replicates the rule in the
30- # CMakeLists on the "cxx_abiobjects" target.
31- configs -= [ " //build/config/compiler:cxx_version_default" ]
32- configs += [ " //build/config/compiler:cxx_version_11" ]
33-
34- configs += [ " ../libcxx:libcxx_config" ]
35-
36- # No translation units in the engine are built with exceptions. But, using
37- # Objective-C exceptions requires some infrastructure setup for exceptions.
38- # Build support for the same in cxxabi on Darwin.
39- if (is_mac || is_ios ) {
40- configs -= [ " //build/config/gcc:no_exceptions" ]
41- sources += [
42- " src/cxa_exception.cpp" ,
43- " src/cxa_personality.cpp" ,
44- ]
45- } else {
46- sources += [ " src/cxa_noexception.cpp" ]
47- }
48-
49- # Third party dependencies may depend on RTTI. Add support for the same in
50- # cxxabi.
51- configs -= [ " //build/config/compiler:no_rtti" ]
52- configs += [ " //build/config/compiler:rtti" ]
53-
54- sources += [
14+ sources = [
5515 " src/abort_message.cpp" ,
5616 " src/cxa_aux_runtime.cpp" ,
5717 " src/cxa_default_handlers.cpp" ,
5818 " src/cxa_demangle.cpp" ,
5919 " src/cxa_exception_storage.cpp" ,
6020 " src/cxa_guard.cpp" ,
6121 " src/cxa_handlers.cpp" ,
22+ " src/cxa_noexception.cpp" ,
6223 " src/cxa_unexpected.cpp" ,
6324 " src/cxa_vector.cpp" ,
6425 " src/cxa_virtual.cpp" ,
@@ -68,4 +29,26 @@ source_set("libcxxabi") {
6829 " src/stdlib_stdexcept.cpp" ,
6930 " src/stdlib_typeinfo.cpp" ,
7031 ]
32+
33+ public_configs = [ " :libcxxabi_config" ]
34+
35+ defines = [
36+ " _LIBCXXABI_NO_EXCEPTIONS" ,
37+ " _LIBCXXABI_BUILDING_LIBRARY" ,
38+ " LIBCXXABI_SILENT_TERMINATE" ,
39+ ]
40+
41+ # ICU uses RTTI, so we need to build libcxxabi with support for it,
42+ # https://github.com/flutter/flutter/issues/24535.
43+ configs -= [ " //build/config/compiler:no_rtti" ]
44+
45+ # Compile libcxx ABI using an older standard. This replicates the rule in the
46+ # CMakeLists on the "cxx_abiobjects" target.
47+ configs -= [ " //build/config/compiler:cxx_version_default" ]
48+ configs += [ " //build/config/compiler:cxx_version_11" ]
49+
50+ configs += [
51+ " //build/config/compiler:rtti" ,
52+ " //third_party/libcxx:libcxx_config" ,
53+ ]
7154}
0 commit comments