@@ -14,8 +14,9 @@ CRONET_GO_VERSION := $(shell cat hiddify-sing-box/.github/CRONET_GO_VERSION)
1414TAGS =with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_grpc,with_awg,with_naive_outbound,tfogo_checklinkname0
1515IOS_ADD_TAGS =with_dhcp,with_low_memory,with_conntrack
1616WINDOWS_ADD_TAGS =with_purego
17- GOBUILDLIB=CGO_ENABLED =1 go build -trimpath -ldflags="-w -s -checklinkname=0 -buildid= $${CODE_VERSION}" -buildmode=c-shared
18- GOBUILDSRV=CGO_ENABLED =1 go build -ldflags "-s -w $${CODE_VERSION}" -trimpath -tags $(TAGS )
17+ LDFLAGS =-w -s -checklinkname=0 -buildid= $${CODE_VERSION}
18+ GOBUILDLIB=CGO_ENABLED =1 go build -trimpath -ldflags="$(LDFLAGS ) " -buildmode=c-shared
19+ GOBUILDSRV=CGO_ENABLED =1 go build -ldflags="$(LDFLAGS ) " -trimpath -tags $(TAGS )
1920
2021CRONET_DIR =./cronet
2122.PHONY : protos
@@ -43,15 +44,15 @@ headers:
4344 go build -buildmode=c-archive -o $(BINDIR ) / ./platform/desktop2
4445
4546android : lib_install
46- gomobile bind -v -androidapi=21 -javapkg=com.hiddify.core -libname=hiddify-core -tags=$(TAGS ) -trimpath -ldflags -checklinkname=0 -target=android -gcflags " all=-N -l" -o $(BINDIR ) /$(LIBNAME ) .aar github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
47+ gomobile bind -v -androidapi=21 -javapkg=com.hiddify.core -libname=hiddify-core -tags=$(TAGS ) -trimpath -ldflags= " $( LDFLAGS ) " -target=android -gcflags " all=-N -l" -o $(BINDIR ) /$(LIBNAME ) .aar github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
4748
4849ios-full : lib_install
49- gomobile bind -v -target ios,iossimulator,tvos,tvossimulator,macos -libname=hiddify-core -tags=$(TAGS ) ,$(IOS_ADD_TAGS ) -trimpath -ldflags=" -w -s " -o $(BINDIR ) /$(PRODUCT_NAME ) .xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
50+ gomobile bind -v -target ios,iossimulator,tvos,tvossimulator,macos -libname=hiddify-core -tags=$(TAGS ) ,$(IOS_ADD_TAGS ) -trimpath -ldflags=" $( LDFLAGS ) " -o $(BINDIR ) /$(PRODUCT_NAME ) .xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
5051 mv $(BINDIR ) /$(PRODUCT_NAME ) .xcframework $(BINDIR ) /$(LIBNAME ) .xcframework
5152 cp HiddifyCore.podspec $(BINDIR ) /$(LIBNAME ) .xcframework/
5253
5354ios : lib_install
54- gomobile bind -v -target ios -libname=hiddify-core -tags=$(TAGS ) ,$(IOS_ADD_TAGS ) -trimpath -ldflags=" -w -s " -o $(BINDIR ) /HiddifyCore.xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
55+ gomobile bind -v -target ios -libname=hiddify-core -tags=$(TAGS ) ,$(IOS_ADD_TAGS ) -trimpath -ldflags=" $( LDFLAGS ) " -o $(BINDIR ) /HiddifyCore.xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
5556 cp Info.plist $(BINDIR ) /HiddifyCore.xcframework/
5657
5758
@@ -154,7 +155,7 @@ linux-custom: prepare install_cronet
154155 mkdir -p $(BINDIR ) /
155156 # env GOARCH=mips $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME) ./cmd/
156157 $(load_cronet_env )
157- go build -ldflags " -s -w " -trimpath -tags $(TAGS ) -o $(BINDIR ) /$(CLINAME ) ./cmd/main
158+ go build -ldflags= " $( LDFLAGS ) " -trimpath -tags $(TAGS ) -o $(BINDIR ) /$(CLINAME ) ./cmd/main
158159 chmod +x $(BINDIR ) /$(CLINAME )
159160 make webui
160161
0 commit comments