diff options
author | Brad King <brad.king@kitware.com> | 2013-02-06 21:21:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-06 21:22:02 (GMT) |
commit | 10e8b2da37ff207a7e1a984a5a413c37bf0c8aa4 (patch) | |
tree | 667f3c1df8551a908f4853b678b92aa247504af6 /Modules/CMakeParseImplicitLinkInfo.cmake | |
parent | 1d3b35fd8a59c6f987b4caab17330955dbaf32bc (diff) | |
download | CMake-10e8b2da37ff207a7e1a984a5a413c37bf0c8aa4.zip CMake-10e8b2da37ff207a7e1a984a5a413c37bf0c8aa4.tar.gz CMake-10e8b2da37ff207a7e1a984a5a413c37bf0c8aa4.tar.bz2 |
Normalize full paths in implicit link library list
Teach CMakeParseImplicitLinkInfo to convert implicit link library full
paths to a canonical form. This makes them more reproducible in case
different language compiler front-ends add the same library by different
paths e.g. ".../libA.a" and "...//libA.a".
Add a case to the CMake.ImplicitLinkInfo test to cover removal of extra
slashes from both library and directory paths.
Diffstat (limited to 'Modules/CMakeParseImplicitLinkInfo.cmake')
-rw-r--r-- | Modules/CMakeParseImplicitLinkInfo.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index ecb20dc..8c914b3 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -103,6 +103,12 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex) foreach(lib IN LISTS implicit_libs_tmp) if("${lib}" MATCHES "^(crt.*\\.o|gcc.*|System.*)$") set(log "${log} remove lib [${lib}]\n") + elseif(IS_ABSOLUTE "${lib}") + get_filename_component(abs "${lib}" ABSOLUTE) + if(NOT "x${lib}" STREQUAL "x${abs}") + set(log "${log} collapse lib [${lib}] ==> [${abs}]\n") + endif() + list(APPEND implicit_libs "${abs}") else() list(APPEND implicit_libs "${lib}") endif() |