From 3e7100644861368b5ec951cf36c631e0828012f8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 25 Oct 2016 10:22:03 +0200 Subject: [PATCH] CMake: Followup to previous commit, try to ensure -ldl is always last Seems CMake will rearrange and copy libraries which are passed to the linker when some of the libraries is listed twice (for example, -lz from png libraries and -l for blender itself). This was causing libopenimageio to be added somewhere at the end of linking flags without -ldl followed after which was causing linking issues. --- build_files/cmake/macros.cmake | 3 ++- build_files/cmake/platform/platform_unix.cmake | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 5a67ac981a3..2e3a1907063 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -518,7 +518,8 @@ function(setup_liblinks target_link_libraries(${target} ${BLENDER_GL_LIBRARIES}) - target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) + #target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) + target_link_libraries(${target} ${PLATFORM_LINKLIBS}) endfunction() diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 62f44cf1739..e33141f8012 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -298,7 +298,6 @@ if(WITH_OPENIMAGEIO) ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES} - ${CMAKE_DL_LIBS} ) set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere set(OPENIMAGEIO_DEFINITIONS "")