diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-12-06 18:52:01 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-12-08 20:57:44 -0500 |
| commit | 56db9d52a1d99f3de61b770ee696a3cdc97d6ded (patch) | |
| tree | a5677b62bd58d63ff745ae66e24556a4c78eb83b /classes | |
| parent | 6c71c81ea53378b23353ce69562d41f52fc71263 (diff) | |
| download | meta-virtualization-56db9d52a1d99f3de61b770ee696a3cdc97d6ded.tar.gz | |
go-mod-discovery: support multi-patckage build
When building multiple packages (./... or multiple targets), go build
requires the output to be a directory. Create the directory and use it.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/go-mod-discovery.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/go-mod-discovery.bbclass b/classes/go-mod-discovery.bbclass index 87cd9def..fc7c2008 100644 --- a/classes/go-mod-discovery.bbclass +++ b/classes/go-mod-discovery.bbclass | |||
| @@ -205,7 +205,11 @@ Hint: Set GO_MOD_DISCOVERY_SRCDIR to the directory containing go.mod" | |||
| 205 | BUILD_CMD="${BUILD_CMD} -tags \"${TAGS}\"" | 205 | BUILD_CMD="${BUILD_CMD} -tags \"${TAGS}\"" |
| 206 | fi | 206 | fi |
| 207 | BUILD_CMD="${BUILD_CMD} -ldflags \"${GO_MOD_DISCOVERY_LDFLAGS}\"" | 207 | BUILD_CMD="${BUILD_CMD} -ldflags \"${GO_MOD_DISCOVERY_LDFLAGS}\"" |
| 208 | BUILD_CMD="${BUILD_CMD} -o \"${GO_MOD_DISCOVERY_OUTPUT}\" ${GO_MOD_DISCOVERY_BUILD_TARGET}" | 208 | |
| 209 | # When building multiple packages (./... or multiple targets), go build | ||
| 210 | # requires the output to be a directory. Create the directory and use it. | ||
| 211 | mkdir -p "${GO_MOD_DISCOVERY_OUTPUT}" | ||
| 212 | BUILD_CMD="${BUILD_CMD} -o \"${GO_MOD_DISCOVERY_OUTPUT}/\" ${GO_MOD_DISCOVERY_BUILD_TARGET}" | ||
| 209 | 213 | ||
| 210 | echo "Executing: ${BUILD_CMD}" | 214 | echo "Executing: ${BUILD_CMD}" |
| 211 | eval ${BUILD_CMD} | 215 | eval ${BUILD_CMD} |
