enable 32bit builds on 64-bit hosts

This commit is contained in:
Grant Limberg 2020-06-10 15:31:40 -07:00
parent 96965647bc
commit 3268effabf
No known key found for this signature in database
GPG key ID: 2BA62CCABBB4095A
3 changed files with 16 additions and 6 deletions

View file

@ -104,6 +104,11 @@ else(WIN32)
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
$<$<CONFIG:RELWITHDEBINFO>:-g>
)
option(BUILD_32BIT "Force building as 32-bit binary")
if(BUILD_32BIT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
endif(BUILD_32BIT)
endif(APPLE)
endif(WIN32)

7
Jenkinsfile vendored
View file

@ -282,9 +282,14 @@ def buildDebianNative() {
}
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
runtime.inside {
def cmakeFlags = ""
if (arch == "i386") {
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1"'
}
sh 'whoami'
dir("build") {
sh 'make -j4'
sh "${cmakeFlags} make -j4"
}
// sh "mkdir -p ${distro}"
// sh "mv *.deb ${distro}"

View file

@ -7,19 +7,19 @@ all: setup
cd ${BUILDDIR} && $(MAKE) -j$(shell getconf _NPROCESSORS_ONLN)
setup:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
setup-debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS}
debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug && $(MAKE)
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} && $(MAKE)
central-controller:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CENTRAL_CONTROLLER=1 && $(MAKE) -j4
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
central-controller-debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_CENTRAL_CONTROLLER=1 && $(MAKE) -j4
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
central-controller-docker:
docker build -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f controller/central-docker/Dockerfile .