changeset 853:16428c4ecb22

Remove testfifo if pthread_barriers are not available
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 21 Oct 2012 17:41:02 +0200
parents 5873c671490f
children 51a056d78aba
files include/freeDiameter/CMakeLists.txt tests/CMakeLists.txt
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/include/freeDiameter/CMakeLists.txt	Sun Oct 21 17:27:31 2012 +0200
+++ b/include/freeDiameter/CMakeLists.txt	Sun Oct 21 17:41:02 2012 +0200
@@ -168,6 +168,12 @@
 CHECK_SYMBOL_EXISTS(AI_ADDRCONFIG "netdb.h" HAVE_AI_ADDRCONFIG)
 
 
+# Check if barriers are available (for test_fifo)
+SET(CMAKE_REQUIRED_INCLUDES "pthread.h")
+SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+CHECK_FUNCTION_EXISTS (pthread_barrier_wait HAVE_PTHREAD_BAR)
+SET(HAVE_PTHREAD_BAR ${HAVE_PTHREAD_BAR} PARENT_SCOPE)
+
 
 ##########################
 
--- a/tests/CMakeLists.txt	Sun Oct 21 17:27:31 2012 +0200
+++ b/tests/CMakeLists.txt	Sun Oct 21 17:41:02 2012 +0200
@@ -24,13 +24,20 @@
 	testpeers
 	testdict
 	testmesg
-	testfifo
 	testsess
 	testdisp
 	testcnx
 	testloadext
 )
 
+IF(HAVE_PTHREAD_BAR)
+SET(TEST_LIST
+	${TEST_LIST}
+	testfifo
+)
+ENDIF(HAVE_PTHREAD_BAR)
+
+
 #############################
 # Some parameters for the tests
 
"Welcome to our mercurial repository"