Merge topic 'osx-dependent-libraries'

5d99343 Do not link private dependent shared libraries on OS X > 10.4
This commit is contained in:
David Cole 2011-12-16 10:15:07 -05:00 committed by CMake Topic Stage
commit 65db5b4a99
2 changed files with 10 additions and 6 deletions

View File

@ -187,11 +187,13 @@ IF(XCODE)
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
ENDIF(XCODE)
# Need to list dependent shared libraries on link line. When building
# with -isysroot (for universal binaries), the linker always looks for
# dependent libraries under the sysroot. Listing them on the link
# line works around the problem.
SET(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
IF("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
# Need to list dependent shared libraries on link line. When building
# with -isysroot (for universal binaries), the linker always looks for
# dependent libraries under the sysroot. Listing them on the link
# line works around the problem.
SET(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
ENDIF()
SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)

View File

@ -161,7 +161,9 @@ listed on the command line.
- On Windows, DLLs are not directly linked, and the import libraries
have no transitive dependencies.
- On Mac, we need to actually list the transitive dependencies.
- On Mac OS X 10.5 and above transitive dependencies are not needed.
- On Mac OS X 10.4 and below we need to actually list the dependencies.
Otherwise when using -isysroot for universal binaries it cannot
find the dependent libraries. Listing them on the command line
tells the linker where to find them, but unfortunately also links