On Fri, Apr 9, 2010 at 8:46 AM, Dave Airlie <airl...@gmail.com> wrote:
> So I don't understand cmake,
>
> but there is a lot of implicit linking going on in piglit, and in
> Fedora 13 our linker doesn't like that anymore.
>
> So for example the fp-rfl test uses sqrt which means it needs to link
> to libm not get libm via other links,
> glx-multithread needs to link to pthread etc.
>
> How do I add per-app linking clauses to the cmake files?
>

Here is a patch (split into two) I sent to Haehnle a few weeks ago but
he said he was busy traveling.

I only had a problem with glx-multithread and pthread though (fixed by
0001), not with fp-rfl and sqrt/libm .
From 113d7e7d634c067c3f9865c15d272290aab019db Mon Sep 17 00:00:00 2001
From: Xavier Chantry <chantry.xav...@gmail.com>
Date: Fri, 26 Mar 2010 19:04:01 +0100
Subject: [PATCH 1/2] glx-multithread needs -lpthread

Add pthread to link glx-multithread

Signed-off-by: Xavier Chantry <chantry.xav...@gmail.com>
---
 tests/glx/CMakeLists.txt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/glx/CMakeLists.txt b/tests/glx/CMakeLists.txt
index a6b9b5d..2ea6c1d 100644
--- a/tests/glx/CMakeLists.txt
+++ b/tests/glx/CMakeLists.txt
@@ -21,5 +21,6 @@ link_libraries (
 
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 	add_executable (glx-multithread glx-multithread.c)
+	target_link_libraries(glx-multithread pthread)
 	add_executable (glx-swap-exchange glx-swap-exchange.c)
 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-- 
1.7.0.4

From 689fcf68085f82a748999ea88163a3c76230ccd6 Mon Sep 17 00:00:00 2001
From: Xavier Chantry <chantry.xav...@gmail.com>
Date: Fri, 26 Mar 2010 19:04:01 +0100
Subject: [PATCH 2/2] Add a minimum cmake version

So that cmake stops complaining.

This apparently causes a change in add_definitions behavior and I had to
remove \\\" to make shaders work.

Signed-off-by: Xavier Chantry <chantry.xav...@gmail.com>
---
 CMakeLists.txt            |    2 ++
 tests/util/CMakeLists.txt |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5f9e6d..567a834 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,5 @@
+cmake_minimum_required(VERSION 2.6)
+
 INCLUDE (CheckCCompilerFlag)
 
 project (piglit)
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 2d036a7..acc1dbb 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_definitions ( -DSOURCE_DIR="\\\"${piglit_SOURCE_DIR}/\\\"" )
+add_definitions ( -DSOURCE_DIR="${piglit_SOURCE_DIR}/" )
 
 include_directories(
 	${OPENGL_INCLUDE_PATH}
-- 
1.7.0.4

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to