mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-16 02:41:09 +07:00
chore: abuse spaces for cgo_enabled.mk
This commit is contained in:
@ -4,29 +4,29 @@
|
||||
#
|
||||
|
||||
ifneq ($(KEEP_CGO_ENVS),1)
|
||||
ifdef CGO_ENABLED_NDEF
|
||||
export CGO_ENABLED := 0
|
||||
endif
|
||||
ifeq ($(CGO_ENABLED),0)
|
||||
ifdef GOARCH_NDEF
|
||||
ifeq ($(CC),cc)
|
||||
ifneq ($(shell which musl-gcc),)
|
||||
export CC := musl-gcc
|
||||
else ifneq ($(shell which zig),)
|
||||
export CC := zig cc -target $(shell . install/musl-targets.sh && echo $$GOARCH_$(GOARCH))
|
||||
else
|
||||
$(info ! CGO_ENABLED=0 is not recommended. Please consider to install musl-gcc for static link instead. See https://github.com/daeuniverse/dae/issues/557)
|
||||
endif
|
||||
endif
|
||||
else ifneq ($(shell which zig),)
|
||||
export CC := zig cc -target $(shell . install/musl-targets.sh && echo $$GOARCH_$(GOARCH))
|
||||
else
|
||||
$(info ! CGO_ENABLED=0 is not recommended. See https://github.com/daeuniverse/dae/issues/557)
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CC),cc)
|
||||
export CGO_ENABLED := 1
|
||||
GO_LDFLAGS += -linkmode external -extldflags=-static
|
||||
$(info * Building dae with "$(CC)" static linking instead of CGO_ENABLED=0. See https://github.com/daeuniverse/dae/issues/557)
|
||||
endif
|
||||
ifdef CGO_ENABLED_NDEF
|
||||
export CGO_ENABLED := 0
|
||||
endif
|
||||
ifeq ($(CGO_ENABLED),0)
|
||||
ifdef GOARCH_NDEF
|
||||
ifeq ($(CC),cc)
|
||||
ifneq ($(shell which musl-gcc),)
|
||||
export CC := musl-gcc
|
||||
else ifneq ($(shell which zig),)
|
||||
export CC := zig cc -target $(shell . install/musl-targets.sh && echo $$GOARCH_$(GOARCH))
|
||||
else
|
||||
$(info ! CGO_ENABLED=0 is not recommended. Please consider to install musl-gcc for static link instead. See https://github.com/daeuniverse/dae/issues/557)
|
||||
endif
|
||||
endif
|
||||
else ifneq ($(shell which zig),)
|
||||
export CC := zig cc -target $(shell . install/musl-targets.sh && echo $$GOARCH_$(GOARCH))
|
||||
else
|
||||
$(info ! CGO_ENABLED=0 is not recommended. See https://github.com/daeuniverse/dae/issues/557)
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CC),cc)
|
||||
export CGO_ENABLED := 1
|
||||
GO_LDFLAGS += -linkmode external -extldflags=-static
|
||||
$(info * Building dae with "$(CC)" static linking instead of CGO_ENABLED=0. See https://github.com/daeuniverse/dae/issues/557)
|
||||
endif
|
||||
endif
|
||||
|
Reference in New Issue
Block a user