-
- Downloads
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.
Showing
- Modules/CMakeDetermineCompilerABI.cmake 9 additions, 12 deletionsModules/CMakeDetermineCompilerABI.cmake
- Modules/CMakeParseImplicitLinkInfo.cmake 26 additions, 3 deletionsModules/CMakeParseImplicitLinkInfo.cmake
- Modules/Platform/Darwin-Clang.cmake 1 addition, 0 deletionsModules/Platform/Darwin-Clang.cmake
- Modules/Platform/Darwin-GNU.cmake 1 addition, 0 deletionsModules/Platform/Darwin-GNU.cmake
- Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in 97 additions, 0 deletionsTests/CMakeTests/ImplicitLinkInfoTest.cmake.in
Loading
Please register or sign in to comment