Commits

Christian Fischer committed 21fe4b0

adjusted cmake configuration for testing targets

  • Participants
  • Parent commits 54c5970

Comments (0)

Files changed (1)

File build/cmake/modules/wiesel-testsuite.cmake

 
 	set(GOOGLETEST_CMAKE_ARGS
 	)
-
+	
 	# for MinGW we need to disable threading, because it's missing some POSIX functions
 	if (MINGW OR MSYS)
+		set(GOOGLETEST_ADD_PTHREADS_SUPPORT	FALSE)
+	else()
+		set(GOOGLETEST_ADD_PTHREADS_SUPPORT	TRUE)
+	endif(MINGW OR MSYS)
+
+	# disable pthread support on googletest
+	if (NOT GOOGLETEST_ADD_PTHREADS_SUPPORT)
 		set(
 				GOOGLETEST_CMAKE_ARGS
 				${GOOGLETEST_CMAKE_ARGS}
 		add_dependencies(${TEST_NAME} ${target})
 		target_link_libraries(${TEST_NAME} ${target})
 
+		# link pthread library if required
+		if (GOOGLETEST_ADD_PTHREADS_SUPPORT)
+			target_link_libraries(${TEST_NAME} pthread)
+		endif(GOOGLETEST_ADD_PTHREADS_SUPPORT)
+
 		# finally create the test
 		add_test(
 				NAME				${target}