aboutsummaryrefslogtreecommitdiff
path: root/bazel
diff options
context:
space:
mode:
authorChristopher Parsons <cparsons@google.com>2021-04-06 17:57:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-04-06 17:57:59 +0000
commitb7c6a7ef36d5bff40da3132aec567c4543603a34 (patch)
tree5186df38a6a1a0f999a10678a12da32cf69262ea /bazel
parente09691ce787d18bc7f681edb690f8b6e0ba53c7f (diff)
parenteefc9e6a624e78e1c1565656f7ec5e0a655590b0 (diff)
downloadsoong-b7c6a7ef36d5bff40da3132aec567c4543603a34.tar.gz
Merge "Fix note_memtag bionic libraries in mixed builds"
Diffstat (limited to 'bazel')
-rw-r--r--bazel/cquery/request_type.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/bazel/cquery/request_type.go b/bazel/cquery/request_type.go
index 41908b2b8..affb5cead 100644
--- a/bazel/cquery/request_type.go
+++ b/bazel/cquery/request_type.go
@@ -78,7 +78,17 @@ func (g getOutputFilesAndCcObjectFilesType) ParseResult(rawString string) interf
splitString := strings.Split(rawString, "|")
outputFilesString := splitString[0]
ccObjectsString := splitString[1]
- outputFiles = strings.Split(outputFilesString, ", ")
- ccObjects = strings.Split(ccObjectsString, ", ")
+ outputFiles = splitOrEmpty(outputFilesString, ", ")
+ ccObjects = splitOrEmpty(ccObjectsString, ", ")
return GetOutputFilesAndCcObjectFiles_Result{outputFiles, ccObjects}
}
+
+// splitOrEmpty is a modification of strings.Split() that returns an empty list
+// if the given string is empty.
+func splitOrEmpty(s string, sep string) []string {
+ if len(s) < 1 {
+ return []string{}
+ } else {
+ return strings.Split(s, sep)
+ }
+}