Add option to build tox-bootstrapd

When cross-compiling to <target> from Linux, cmake might find native Linux
libconfig and decide to build tox-bootstrapd. If the target is Windows, this
will fail, as tox-bootstrapd can't be built for Windows in the first place. If
the target is Linux of some other architecture, then using host native
libconfig will fail too. Thus an option is needed to guard against this.
This commit is contained in:
Maxim Biro 2016-10-03 01:52:43 -04:00
parent 90123c803a
commit 02e9cd38f1
5 changed files with 25 additions and 15 deletions

View File

@ -304,7 +304,12 @@ add_c_executable(DHT_bootstrap
other/bootstrap_node_packets.c) other/bootstrap_node_packets.c)
target_link_modules(DHT_bootstrap toxnetcrypto) target_link_modules(DHT_bootstrap toxnetcrypto)
if(LIBCONFIG_FOUND) option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON)
if(BOOTSTRAP_DAEMON)
if(WIN32)
message(FATAL_ERROR "Building tox-bootstrapd for Windows is not supported")
endif()
if(LIBCONFIG_FOUND)
add_c_executable(tox-bootstrapd add_c_executable(tox-bootstrapd
other/bootstrap_daemon/src/command_line_arguments.c other/bootstrap_daemon/src/command_line_arguments.c
other/bootstrap_daemon/src/command_line_arguments.h other/bootstrap_daemon/src/command_line_arguments.h
@ -318,6 +323,7 @@ if(LIBCONFIG_FOUND)
other/bootstrap_node_packets.c other/bootstrap_node_packets.c
other/bootstrap_node_packets.h) other/bootstrap_node_packets.h)
target_link_modules(tox-bootstrapd toxnetcrypto ${LIBCONFIG_LIBRARIES}) target_link_modules(tox-bootstrapd toxnetcrypto ${LIBCONFIG_LIBRARIES})
endif()
endif() endif()
################################################################################ ################################################################################

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
CMAKE=cmake CMAKE=cmake
CMAKE_EXTRA_FLAGS=""
NPROC=`nproc` NPROC=`nproc`
CURDIR=$PWD CURDIR=$PWD

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
CMAKE=cmake CMAKE=cmake
CMAKE_EXTRA_FLAGS=""
NPROC=`sysctl -n hw.ncpu` NPROC=`sysctl -n hw.ncpu`
CURDIR=$PWD CURDIR=$PWD

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
CMAKE=$ARCH-w64-mingw32.shared-cmake CMAKE=$ARCH-w64-mingw32.shared-cmake
CMAKE_EXTRA_FLAGS="-DBOOTSTRAP_DAEMON=OFF"
NPROC=`nproc` NPROC=`nproc`
CURDIR=/work CURDIR=/work

View File

@ -13,7 +13,8 @@ RUN $CMAKE \
-DDEBUG=ON \ -DDEBUG=ON \
-DASSOC_DHT=ON \ -DASSOC_DHT=ON \
-DSTRICT_ABI=ON \ -DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=300 #-DASAN=ON -DTEST_TIMEOUT_SECONDS=300 \
$CMAKE_EXTRA_FLAGS #-DASAN=ON
export CTEST_OUTPUT_ON_FAILURE=1 export CTEST_OUTPUT_ON_FAILURE=1