summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2016-10-03 01:52:43 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2016-10-05 23:47:39 -0400
commit02e9cd38f107302f4384129ae23e92d250605453 (patch)
tree8d051ce6f9ec4c6c826e0b45604af41d9501e2af
parent90123c803abd0cd51c5fff255aa75b3d1b45cd85 (diff)
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.
-rw-r--r--CMakeLists.txt34
-rw-r--r--other/travis/env-linux.sh1
-rw-r--r--other/travis/env-osx.sh1
-rw-r--r--other/travis/env-windows.sh1
-rwxr-xr-xother/travis/toxcore-script3
5 files changed, 25 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6f74e6a..f300cd90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -304,20 +304,26 @@ add_c_executable(DHT_bootstrap
304 other/bootstrap_node_packets.c) 304 other/bootstrap_node_packets.c)
305target_link_modules(DHT_bootstrap toxnetcrypto) 305target_link_modules(DHT_bootstrap toxnetcrypto)
306 306
307if(LIBCONFIG_FOUND) 307option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON)
308 add_c_executable(tox-bootstrapd 308if(BOOTSTRAP_DAEMON)
309 other/bootstrap_daemon/src/command_line_arguments.c 309 if(WIN32)
310 other/bootstrap_daemon/src/command_line_arguments.h 310 message(FATAL_ERROR "Building tox-bootstrapd for Windows is not supported")
311 other/bootstrap_daemon/src/config.c 311 endif()
312 other/bootstrap_daemon/src/config_defaults.h 312 if(LIBCONFIG_FOUND)
313 other/bootstrap_daemon/src/config.h 313 add_c_executable(tox-bootstrapd
314 other/bootstrap_daemon/src/log.c 314 other/bootstrap_daemon/src/command_line_arguments.c
315 other/bootstrap_daemon/src/log.h 315 other/bootstrap_daemon/src/command_line_arguments.h
316 other/bootstrap_daemon/src/tox-bootstrapd.c 316 other/bootstrap_daemon/src/config.c
317 other/bootstrap_daemon/src/global.h 317 other/bootstrap_daemon/src/config_defaults.h
318 other/bootstrap_node_packets.c 318 other/bootstrap_daemon/src/config.h
319 other/bootstrap_node_packets.h) 319 other/bootstrap_daemon/src/log.c
320 target_link_modules(tox-bootstrapd toxnetcrypto ${LIBCONFIG_LIBRARIES}) 320 other/bootstrap_daemon/src/log.h
321 other/bootstrap_daemon/src/tox-bootstrapd.c
322 other/bootstrap_daemon/src/global.h
323 other/bootstrap_node_packets.c
324 other/bootstrap_node_packets.h)
325 target_link_modules(tox-bootstrapd toxnetcrypto ${LIBCONFIG_LIBRARIES})
326 endif()
321endif() 327endif()
322 328
323################################################################################ 329################################################################################
diff --git a/other/travis/env-linux.sh b/other/travis/env-linux.sh
index 2544ee56..16dbb8cc 100644
--- a/other/travis/env-linux.sh
+++ b/other/travis/env-linux.sh
@@ -1,6 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3CMAKE=cmake 3CMAKE=cmake
4CMAKE_EXTRA_FLAGS=""
4NPROC=`nproc` 5NPROC=`nproc`
5CURDIR=$PWD 6CURDIR=$PWD
6 7
diff --git a/other/travis/env-osx.sh b/other/travis/env-osx.sh
index e45c34a7..86d16ade 100644
--- a/other/travis/env-osx.sh
+++ b/other/travis/env-osx.sh
@@ -1,6 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3CMAKE=cmake 3CMAKE=cmake
4CMAKE_EXTRA_FLAGS=""
4NPROC=`sysctl -n hw.ncpu` 5NPROC=`sysctl -n hw.ncpu`
5CURDIR=$PWD 6CURDIR=$PWD
6 7
diff --git a/other/travis/env-windows.sh b/other/travis/env-windows.sh
index d7eecada..8c9b9c65 100644
--- a/other/travis/env-windows.sh
+++ b/other/travis/env-windows.sh
@@ -1,6 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3CMAKE=$ARCH-w64-mingw32.shared-cmake 3CMAKE=$ARCH-w64-mingw32.shared-cmake
4CMAKE_EXTRA_FLAGS="-DBOOTSTRAP_DAEMON=OFF"
4NPROC=`nproc` 5NPROC=`nproc`
5CURDIR=/work 6CURDIR=/work
6 7
diff --git a/other/travis/toxcore-script b/other/travis/toxcore-script
index fe0a35e4..e023ff81 100755
--- a/other/travis/toxcore-script
+++ b/other/travis/toxcore-script
@@ -13,7 +13,8 @@ RUN $CMAKE \
13 -DDEBUG=ON \ 13 -DDEBUG=ON \
14 -DASSOC_DHT=ON \ 14 -DASSOC_DHT=ON \
15 -DSTRICT_ABI=ON \ 15 -DSTRICT_ABI=ON \
16 -DTEST_TIMEOUT_SECONDS=300 #-DASAN=ON 16 -DTEST_TIMEOUT_SECONDS=300 \
17 $CMAKE_EXTRA_FLAGS #-DASAN=ON
17 18
18export CTEST_OUTPUT_ON_FAILURE=1 19export CTEST_OUTPUT_ON_FAILURE=1
19 20