[Bf-blender-cvs] [fdbedfe] blender-v2.73-release: Fix gtest linking on ubuntu and do minor cleanup.

Antony Riakiotakis noreply at git.blender.org
Tue Jan 20 10:23:23 CET 2015


Commit: fdbedfef696c8212b20f165cc41e2c2811978def
Author: Antony Riakiotakis
Date:   Thu Jan 8 17:17:40 2015 +0100
Branches: blender-v2.73-release
https://developer.blender.org/rBfdbedfef696c8212b20f165cc41e2c2811978def

Fix gtest linking on ubuntu and do minor cleanup.

Generally for build systems, libraries that do not depend on other
libraries, such as system libraries, OpenGL etc always go at the end.

We could even get rid of some duplicate dependency libraries here but
auto duplication by build systems and differences between OSs make this
difficult.

GTest still duplicates all libraries twice to solve some issues which is
weird (maybe libs are not sorted correctly for some reason? needs
investigation)

===================================================================

M	build_files/cmake/Modules/GTestTesting.cmake
M	build_files/cmake/macros.cmake

===================================================================

diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake
index c8719de..fd0379b 100644
--- a/build_files/cmake/Modules/GTestTesting.cmake
+++ b/build_files/cmake/Modules/GTestTesting.cmake
@@ -28,7 +28,6 @@ macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
 
 		add_executable(${NAME}_test ${SRC})
 		target_link_libraries(${NAME}_test
-		                      ${PLATFORM_LINKLIBS}
 		                      ${EXTRA_LIBS}
 		                      bf_testing_main
 		                      bf_intern_guardedalloc
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 40bea5e..f4372a2 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -284,7 +284,6 @@ macro(setup_liblinks
 	set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
 
 	target_link_libraries(${target}
-			${BLENDER_GL_LIBRARIES}
 			${PNG_LIBRARIES}
 			${ZLIB_LIBRARIES}
 			${FREETYPE_LIBRARY})
@@ -357,14 +356,6 @@ macro(setup_liblinks
 		target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
 	endif()
 	if(WITH_CODEC_FFMPEG)
-
-		# Strange! Without this ffmpeg gives linking errors (on linux),
-		# even though it's linked above.
-		# XXX: Does FFMPEG depend on GLU?
-		if(WITH_GLU)
-			target_link_libraries(${target} ${OPENGL_glu_LIBRARY})
-		endif()
-
 		target_link_libraries(${target} ${FFMPEG_LIBRARIES})
 	endif()
 	if(WITH_OPENCOLLADA)
@@ -412,13 +403,17 @@ macro(setup_liblinks
 		target_link_libraries(${target} ${PTHREADS_LIBRARIES})
 	endif()
 
-	target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
-
 	# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
 	if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
 		target_link_libraries(${target} "extern_clew")
 		target_link_libraries(${target} "extern_cuew")
 	endif()
+
+	#system libraries with no dependencies such as platform link libs or opengl should go last
+	target_link_libraries(${target}
+			${BLENDER_GL_LIBRARIES})
+
+	target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
 endmacro()
 
 macro(SETUP_BLENDER_SORTED_LIBS)




More information about the Bf-blender-cvs mailing list