[clfft] 44/107: BUILD FIX: for Linux systems when using static libraries

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 30 18:06:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository clfft.

commit 85a851d63ba25c131cd14abd5893e20b4e436eab
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Tue Mar 24 17:38:32 2015 -0400

    BUILD FIX: for Linux systems when using static libraries
    
    Tests, examples and other downstream binaries need CMAKE_DL_LIBS
---
 src/examples/CMakeLists.txt |  2 +-
 src/tests/CMakeLists.txt    | 17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index b4c4b6b..5fd08f6 100644
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -40,7 +40,7 @@ FOREACH(FILE ${FILES})
     SET(EXAMPLE_NAME example_${DIR_NAME}_${EXAMPLE})
     ADD_EXECUTABLE(${EXAMPLE_NAME} ${FILE})
 
-    TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} clFFT ${OPENCL_LIBRARIES})
+    TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} clFFT ${OPENCL_LIBRARIES} ${CMAKE_DL_LIBS})
 
     SET_TARGET_PROPERTIES(${EXAMPLE_NAME}
         PROPERTIES
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 8ee80a3..88904b5 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -1,12 +1,12 @@
 # ########################################################################
 # Copyright 2013 Advanced Micro Devices, Inc.
-# 
+#
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
-# 
+#
 # http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ set( clFFT.Test.Source
 	 ${PROJECT_SOURCE_DIR}/client/openCL.misc.cpp
 	 c-compliance.c
    )
-   
+
 set( clFFT.Test.Headers
 	${PROJECT_SOURCE_DIR}/include/clFFT.h
 	${PROJECT_SOURCE_DIR}/include/unicode.compatibility.h
@@ -46,7 +46,7 @@ set( clFFT.Test.Headers
 	fftw_transform.h
 	typedefs.h
   )
-  
+
 set( clFFT.Test.Files ${clFFT.Test.Source} ${clFFT.Test.Headers} )
 
 set( LD_PTHREAD "" )
@@ -69,7 +69,7 @@ add_executable( Test ${clFFT.Test.Files} )
 
 # If the runtime is being built by the project, use it, otherwise link to a runtime library specified in the install prefix
 if( BUILD_RUNTIME )
-	target_link_libraries( Test clFFT ${Boost_LIBRARIES} ${GTEST_LIBRARIES} ${FFTW_LIBRARIES} ${OPENCL_LIBRARIES} ${LD_PTHREAD} )
+	target_link_libraries( Test clFFT ${Boost_LIBRARIES} ${GTEST_LIBRARIES} ${FFTW_LIBRARIES} ${OPENCL_LIBRARIES} ${LD_PTHREAD} ${CMAKE_DL_LIBS})
 else( )
 	# Search for 64bit libs if FIND_LIBRARY_USE_LIB64_PATHS is set to true in the global environment, 32bit libs else
 	get_property( LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS )
@@ -78,14 +78,14 @@ else( )
 	else( )
 		set( clFFT.library "${CMAKE_INSTALL_PREFIX}/lib32" )
 	endif( )
-	
+
 	if( WIN32 )
 		set( clFFT.library "${clFFT.library}/import/clFFT${CMAKE_STATIC_LIBRARY_SUFFIX}" )
 	else( )
 		set( clFFT.library "${clFFT.library}/${CMAKE_SHARED_LIBRARY_PREFIX}clFFT${CMAKE_SHARED_LIBRARY_SUFFIX}" )
 	endif( )
 
-	target_link_libraries( Test ${clFFT.library} ${Boost_LIBRARIES} ${GTEST_LIBRARIES} ${FFTW_LIBRARIES} ${OPENCL_LIBRARIES} ${LD_PTHREAD} )
+	target_link_libraries( Test ${clFFT.library} ${Boost_LIBRARIES} ${GTEST_LIBRARIES} ${FFTW_LIBRARIES} ${OPENCL_LIBRARIES} ${LD_PTHREAD} ${CMAKE_DL_LIBS})
 
 endif( )
 
@@ -115,4 +115,3 @@ configure_file(
 
 # Register script at run at install time to analyze the executable and copy dependencies into package
 install( SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/copyTestDependencies.cmake")
- 
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clfft.git



More information about the debian-science-commits mailing list