mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-13 13:48:40 +02:00
refactor: small improvements
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
e47bad4997
commit
22a7a9a835
@ -212,15 +212,10 @@ func buildOptionsForTarget(ctx *context.Context, build config.Build, target stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
func extFor(target string, build config.BuildDetails) string {
|
func extFor(target string, build config.BuildDetails) string {
|
||||||
if target == "js_wasm" {
|
|
||||||
return ".wasm"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure the extensions for shared and static libraries - by default .so and .a respectively -
|
// Configure the extensions for shared and static libraries - by default .so and .a respectively -
|
||||||
// with overrides for Windows (.dll for shared and .lib for static) and .dylib for macOS.
|
// with overrides for Windows (.dll for shared and .lib for static) and .dylib for macOS.
|
||||||
buildmode := build.Buildmode
|
switch build.Buildmode {
|
||||||
|
case "c-shared":
|
||||||
if buildmode == "c-shared" {
|
|
||||||
if strings.Contains(target, "darwin") {
|
if strings.Contains(target, "darwin") {
|
||||||
return ".dylib"
|
return ".dylib"
|
||||||
}
|
}
|
||||||
@ -228,15 +223,17 @@ func extFor(target string, build config.BuildDetails) string {
|
|||||||
return ".dll"
|
return ".dll"
|
||||||
}
|
}
|
||||||
return ".so"
|
return ".so"
|
||||||
}
|
case "c-archive":
|
||||||
|
|
||||||
if buildmode == "c-archive" {
|
|
||||||
if strings.Contains(target, "windows") {
|
if strings.Contains(target, "windows") {
|
||||||
return ".lib"
|
return ".lib"
|
||||||
}
|
}
|
||||||
return ".a"
|
return ".a"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if target == "js_wasm" {
|
||||||
|
return ".wasm"
|
||||||
|
}
|
||||||
|
|
||||||
if strings.Contains(target, "windows") {
|
if strings.Contains(target, "windows") {
|
||||||
return ".exe"
|
return ".exe"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user