diff options
author | Christopher Parsons <cparsons@google.com> | 2021-04-06 17:57:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-04-06 17:57:59 +0000 |
commit | b7c6a7ef36d5bff40da3132aec567c4543603a34 (patch) | |
tree | 5186df38a6a1a0f999a10678a12da32cf69262ea /bazel | |
parent | e09691ce787d18bc7f681edb690f8b6e0ba53c7f (diff) | |
parent | eefc9e6a624e78e1c1565656f7ec5e0a655590b0 (diff) | |
download | soong-b7c6a7ef36d5bff40da3132aec567c4543603a34.tar.gz |
Merge "Fix note_memtag bionic libraries in mixed builds"
Diffstat (limited to 'bazel')
-rw-r--r-- | bazel/cquery/request_type.go | 14 |
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) + } +} |