Revert "gn2bp: Convert cc_objects to cc_static_library"
This reverts commit 379d79d1b0984187ec05f370e87e8bc17ae2a33d.
Reason for revert: This is breaking the symbols of test library.
Test: None
Change-Id: I3a2e8a9a6ec6ce04038ed34489ece6a1ca053cef
diff --git a/tools/gn2bp/gn_utils.py b/tools/gn2bp/gn_utils.py
index 4066673..09a7b80 100644
--- a/tools/gn2bp/gn_utils.py
+++ b/tools/gn2bp/gn_utils.py
@@ -429,6 +429,14 @@
target.transitive_proto_deps.add(dep.name)
target.proto_paths.update(dep.proto_paths)
target.transitive_proto_deps.update(dep.transitive_proto_deps)
+ elif dep.type == 'source_set':
+ target.arch[arch].source_set_deps.add(dep.name)
+ target.arch[arch].source_set_deps.update(dep.arch[arch].source_set_deps)
+ # flatten source_set deps
+ if target.is_linker_unit_type():
+ # This ensure that all transitive source set dependencies are
+ # propagated upward to the linker units.
+ target.arch[arch].deps.update(target.arch[arch].source_set_deps)
elif dep.type == 'group':
target.update(dep, arch) # Bubble up groups's cflags/ldflags etc.
elif dep.type in ['action', 'action_foreach', 'copy']:
@@ -442,11 +450,12 @@
# java_library.
pass
- if dep.type in ['static_library', 'source_set']:
- # Bubble up static_libs and source_set. Necessary, since soong does not propagate
+ # Source set bubble up transitive source sets but can't be combined with this
+ # if they are combined then source sets will bubble up static libraries
+ # while we only want to have source sets bubble up only source sets.
+ if dep.type == 'static_library':
+ # Bubble up static_libs. Necessary, since soong does not propagate
# static_libs up the build tree.
- # Source sets are later translated to static_libraries, so it makes sense
- # to reuse transitive_static_libs_deps.
target.arch[arch].transitive_static_libs_deps.add(dep.name)
if arch in dep.arch: