mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 04:53:44 +02:00
added static build option
This commit is contained in:
parent
b88000c349
commit
5166aa6913
2 changed files with 12 additions and 1 deletions
|
@ -105,6 +105,7 @@ else(WIN32)
|
||||||
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||||
)
|
)
|
||||||
option(BUILD_32BIT "Force building as 32-bit binary" OFF)
|
option(BUILD_32BIT "Force building as 32-bit binary" OFF)
|
||||||
|
option(BUILD_STATIC "Build statically linked executable" OFF)
|
||||||
if(BUILD_32BIT)
|
if(BUILD_32BIT)
|
||||||
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||||
|
@ -114,6 +115,11 @@ else(WIN32)
|
||||||
-m32
|
-m32
|
||||||
)
|
)
|
||||||
endif(BUILD_32BIT)
|
endif(BUILD_32BIT)
|
||||||
|
if(BUILD_STATIC)
|
||||||
|
add_link_options(
|
||||||
|
-static
|
||||||
|
)
|
||||||
|
endif(BUILD_STATIC)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
|
|
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
|
@ -55,7 +55,12 @@ def buildStaticBinaries() {
|
||||||
def runtime = docker.image("ztbuild/${distro}-${platform}:latest")
|
def runtime = docker.image("ztbuild/${distro}-${platform}:latest")
|
||||||
runtime.inside {
|
runtime.inside {
|
||||||
dir("build") {
|
dir("build") {
|
||||||
sh 'make -j8 ZT_STATIC=1 all'
|
def cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
|
||||||
|
if (arch == "i386") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1"'
|
||||||
|
}
|
||||||
|
|
||||||
|
sh "${cmakeFlags} make -j8 ZT_STATIC=1 all"
|
||||||
dir("build") {
|
dir("build") {
|
||||||
sh "mv zerotier zerotier-static-${platform}"
|
sh "mv zerotier zerotier-static-${platform}"
|
||||||
stash includes: 'zerotier-static-*', name: "static-${platform}"
|
stash includes: 'zerotier-static-*', name: "static-${platform}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue