bp2build support for host_ldlibs
host_ldlibs are used during linking. Set these in `linkopts` for now.
Note that this CL does not do the `CheckBadHostLdLibs` validation of
Soong. There are some different ways to do this, and these are being
discussed in b/216626461. It is likely that we will need to create a new
property `host_ldlibs` to do the validation. But for now, re-use
`linkopts`.
Bug: 216626461
Test: bp2build unit tests
Change-Id: Id4c77e4460fb1fb003fa58ea27bab5b50ea8cefe
diff --git a/cc/bp2build.go b/cc/bp2build.go
index 29e8494..5029541 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -1254,6 +1254,9 @@
}
la.additionalLinkerInputs.SetSelectValue(axis, config, additionalLinkerInputs)
+ if axis == bazel.OsConfigurationAxis && (config == bazel.OsDarwin || config == bazel.OsLinux || config == bazel.OsWindows) {
+ linkerFlags = append(linkerFlags, props.Host_ldlibs...)
+ }
la.linkopts.SetSelectValue(axis, config, linkerFlags)
if axisFeatures != nil {