Commit Graph

5 Commits

Author SHA1 Message Date
Jean-Christophe Fillion-Robin 63c4133b38 OS X: Use -iframework with Clang only on version >= 3.2
Since commit v3.1.0-rc1~564^2 (OS X: Use -iframework for system
framework directories, 2014-05-05) we test the version of Clang is smaller
that 3.1 to see if it supports -iframework.

Considering that "iframework" support has been added in clang@r142418
(Frontend: Support -iframework.) prior to clang 3.1, this made sense.

That said, considering that support for multiple -iframework parameters
has been added later in clang@r164607 (-iframework should allow separate
arguments. ) prior to clang 3.2, this commit updates the check to enable
framework support only if version is >= 3.2
2016-03-09 08:37:29 -05:00
Mikołaj Siedlarek 1bed75a590 OS X: Use -iframework for system framework directories
Just like -I flag has its -isystem counterpart which marks an include
directory as a system directory and prevents unwanted warnings, on Apple
systems there is -iframework -- a system directory replacement for -F.
Use this flag to implement include_directories(SYSTEM) for frameworks.
2014-05-07 09:04:48 -04:00
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