build: CGO_ENABLED=1 default for C++/GPU backends

- CGO_ENABLED?=1 allows C++/GPU acceleration by default
- Allow CGO_ENABLED=0 override for pure Go builds
This commit is contained in:
Zach Kelling
2026-01-03 06:55:59 -08:00
parent ecefe97063
commit 5d4bdf3368
+3
View File
@@ -10,9 +10,12 @@ BUILD_DIR := build
# Go build flags # Go build flags
GOARCH := $(shell go env GOARCH) GOARCH := $(shell go env GOARCH)
GOOS := $(shell go env GOOS) GOOS := $(shell go env GOOS)
CGO_ENABLED ?= 1
CGO_CFLAGS := -O -D__BLST_PORTABLE__ CGO_CFLAGS := -O -D__BLST_PORTABLE__
LDFLAGS := -X github.com/luxfi/netrunner/cmd.Version=$(VERSION) -X github.com/luxfi/netrunner/cmd.Commit=$(COMMIT) -X github.com/luxfi/netrunner/cmd.BuildDate=$(BUILD_DATE) LDFLAGS := -X github.com/luxfi/netrunner/cmd.Version=$(VERSION) -X github.com/luxfi/netrunner/cmd.Commit=$(COMMIT) -X github.com/luxfi/netrunner/cmd.BuildDate=$(BUILD_DATE)
export CGO_ENABLED
# Default target # Default target
.PHONY: all .PHONY: all
all: build all: build