mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 04:53:44 +02:00
trying again for static build. also add static go flags
This commit is contained in:
parent
541b2cbef0
commit
a1649d6cda
1 changed files with 3 additions and 1 deletions
|
@ -119,6 +119,8 @@ else(WIN32)
|
||||||
add_link_options(
|
add_link_options(
|
||||||
-static
|
-static
|
||||||
)
|
)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-static ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
set(GOFLAGS "-a -tags netgo -ldflags '-w -extldflags \"-static\"")
|
||||||
endif(BUILD_STATIC)
|
endif(BUILD_STATIC)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
@ -149,7 +151,7 @@ file(GLOB go_src
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/zerotier_cgo.h ${CMAKE_BINARY_DIR}/zerotier_cgo.a
|
OUTPUT ${CMAKE_BINARY_DIR}/zerotier_cgo.h ${CMAKE_BINARY_DIR}/zerotier_cgo.a
|
||||||
COMMAND ${GOARCH} CGO_ENABLED=1 ${GO} build -buildmode=c-archive -o ${CMAKE_BINARY_DIR}/zerotier_cgo.a ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go
|
COMMAND ${GOARCH} CGO_ENABLED=1 ${GO} build -buildmode=c-archive ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/zerotier_cgo.a ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go
|
||||||
IMPLICIT_DEPENDS ${go_src}
|
IMPLICIT_DEPENDS ${go_src}
|
||||||
COMMENT "Compiling Go Code..."
|
COMMENT "Compiling Go Code..."
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue