[Piglit] [PATCH 1/3] tests/util: fix detection of strndup

Kenney Phillis kphillisjr at gmail.com
Sat Sep 21 11:30:06 PDT 2013


There is no guarantee that cmake will blindly pass all of the defines
to the preprocessor.
---
 tests/util/CMakeLists.txt |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 8f1420c..1b09437 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -24,6 +24,11 @@ set(UTIL_GL_SOURCES
 	rgb9e5.c
 	)
 
+if(HAVE_STRNDUP)
+	# Make sure to pass this to the preprocessor for the compiler.
+	add_definitions(-DHAVE_STRNDUP)
+endif()
+
 if(PIGLIT_USE_WAFFLE)
 	list(APPEND UTIL_GL_SOURCES
 		piglit-framework-gl/piglit_gbm_framework.c
-- 
1.7.9.5



More information about the Piglit mailing list