diff options
author | Brad King <brad.king@kitware.com> | 2017-04-03 17:19:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-03 17:23:31 (GMT) |
commit | 53f17333f830d4f314bbe10ba32889bbcfbc3c46 (patch) | |
tree | 3eb93f1adc80c3c3a7028d4deab0dea07f17058e /Modules/CMakeParseImplicitLinkInfo.cmake | |
parent | 18eeed41948b265168497ea3360e7b0d56e8e8a9 (diff) | |
download | CMake-53f17333f830d4f314bbe10ba32889bbcfbc3c46.zip CMake-53f17333f830d4f314bbe10ba32889bbcfbc3c46.tar.gz CMake-53f17333f830d4f314bbe10ba32889bbcfbc3c46.tar.bz2 |
CMakeParseImplicitLinkInfo: Ignore ld -lto_library flag
The `ld` tool in Xcode 8.3 now has a `-lto_library <path>` flag. Ignore
the flag instead of accidentally parsing it as `-l` with `to_library`.
Fixes: #16766
Diffstat (limited to 'Modules/CMakeParseImplicitLinkInfo.cmake')
-rw-r--r-- | Modules/CMakeParseImplicitLinkInfo.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 3469d34..3273443 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -49,8 +49,12 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj if("${cmd}" MATCHES "${linker_regex}") string(APPEND log " link line: [${line}]\n") string(REGEX REPLACE ";-([LYz]);" ";-\\1" args "${args}") + set(skip_value_of "") foreach(arg IN LISTS args) - if("${arg}" MATCHES "^-L(.:)?[/\\]") + if(skip_value_of) + string(APPEND log " arg [${arg}] ==> skip value of ${skip_value_of}\n") + set(skip_value_of "") + elseif("${arg}" MATCHES "^-L(.:)?[/\\]") # Unix search path. string(REGEX REPLACE "^-L" "" dir "${arg}") list(APPEND implicit_dirs_tmp ${dir}) @@ -66,6 +70,10 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj set(lib "${CMAKE_MATCH_1}") list(APPEND implicit_libs_tmp ${lib}) string(APPEND log " arg [${arg}] ==> lib [${lib}]\n") + elseif("${arg}" STREQUAL "-lto_library") + # ld argument "-lto_library <path>" + set(skip_value_of "${arg}") + string(APPEND log " arg [${arg}] ==> ignore, skip following value\n") elseif("${arg}" MATCHES "^-l([^:].*)$") # Unix library. set(lib "${CMAKE_MATCH_1}") |