Commit Graph

3 Commits

Author SHA1 Message Date
Brad King 2dd67c7ea0 OS X: Detect implicit link directories on modern toolchains
We detect the implicit link directories for the toolchain by adding a
flag to get verbose output from the compiler front-end while linking the
ABI detection binary.  Newer OS X toolchains based on Clang do not add
the implicit link directories with -L options to their internal
invocation of "ld".  Instead they use a linker that comes with the
toolchain and is already configured with the proper directories.

Add the "-Wl,-v" option to ask "ld" to print its implicit directories.
It displays them in a block such as:

 Library search paths:
	/...

Parse this block to extract the implicit link directories.

While at it, remove the checks introduced by commit efaf335b (Skip
implicit link information on Xcode, 2009-07-23) and commit 5195a664
(Skip implicit link info for multiple OS X archs, 2009-09-22).  Discard
the non-system link directories added by Xcode.  Discard all detected
implicit libraries in the multi-architecture case but keep the
directories.  The directories are still useful without the libraries
just to suppress addition of explicit -L options for them.
2012-12-11 15:15:51 -05:00
Brad King a0a0877a1e OS X: Always generate -isysroot if any SDK is in use
Drop the last use of CMAKE_OSX_SYSROOT_DEFAULT.  Replace internal
platform variable CMAKE_${lang}_HAS_ISYSROOT with a more general
CMAKE_${lang}_SYSROOT_FLAG variable.  If the -isysroot flag exists and
CMAKE_OSX_SYSROOT points to an SDK (not "/") then always add it to
compiler command lines.  This is already done in the Xcode IDE.
2012-09-21 08:53:42 -04:00
Brad King 011d5a4b47 OS X: Add platform-specific Clang compiler info files (#13536)
Clang has the same interface as GNU except that we do not need to test
for the deployment target and sysroot flags.  Simply set variables

 CMAKE_${lang}_HAS_ISYSROOT
 CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG

to true because every version of Clang available on OS X supports these
flags.
2012-09-17 15:36:41 -04:00