mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43: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>
|
||||
)
|
||||
option(BUILD_32BIT "Force building as 32-bit binary" OFF)
|
||||
option(BUILD_STATIC "Build statically linked executable" OFF)
|
||||
if(BUILD_32BIT)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||
|
@ -114,6 +115,11 @@ else(WIN32)
|
|||
-m32
|
||||
)
|
||||
endif(BUILD_32BIT)
|
||||
if(BUILD_STATIC)
|
||||
add_link_options(
|
||||
-static
|
||||
)
|
||||
endif(BUILD_STATIC)
|
||||
endif(APPLE)
|
||||
endif(WIN32)
|
||||
|
||||
|
|
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
|
@ -55,7 +55,12 @@ def buildStaticBinaries() {
|
|||
def runtime = docker.image("ztbuild/${distro}-${platform}:latest")
|
||||
runtime.inside {
|
||||
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") {
|
||||
sh "mv zerotier zerotier-static-${platform}"
|
||||
stash includes: 'zerotier-static-*', name: "static-${platform}"
|
||||
|
|
Loading…
Add table
Reference in a new issue