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