diff options
author | Brad King <brad.king@kitware.com> | 2020-12-03 19:33:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-03 19:34:04 (GMT) |
commit | 1ee99104f76ccd831713816eec588eb5d7e93f8b (patch) | |
tree | 7e40fc28b71f1470c7f6f1da04fff424a81322be /Modules | |
parent | 6cf88734a5545f44d0bba4017ab4dbeebbe5b76b (diff) | |
download | CMake-1ee99104f76ccd831713816eec588eb5d7e93f8b.zip CMake-1ee99104f76ccd831713816eec588eb5d7e93f8b.tar.gz CMake-1ee99104f76ccd831713816eec588eb5d7e93f8b.tar.bz2 |
CMakeDetermineCompilerId: Filter IAR-AVR format INFO strings earlier
Remove the bytes between characters from the entire list at once.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index a982d2c..ca82d8a 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -756,15 +756,16 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) # With the IAR Compiler, some strings are found twice, first time as incomplete # list like "?<Constant "INFO:compiler[IAR]">". Remove the incomplete copies. list(FILTER CMAKE_${lang}_COMPILER_ID_STRINGS EXCLUDE REGEX "\\?<Constant \\\"") + # The IAR-AVR compiler uses a binary format that places a '6' + # character (0x34) before each character in the string. Strip + # out these characters without removing any legitimate characters. + if(CMAKE_${lang}_COMPILER_ID_STRINGS MATCHES "(.)I.N.F.O.:.") + string(REGEX REPLACE "${CMAKE_MATCH_1}([^;])" "\\1" + CMAKE_${lang}_COMPILER_ID_STRINGS "${CMAKE_${lang}_COMPILER_ID_STRINGS}") + endif() # In C# binaries, some strings are found more than once. list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_ID_STRINGS) foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) - # The IAR-AVR compiler uses a binary format that places a '6' - # character (0x34) before each character in the string. Strip - # out these characters without removing any legitimate characters. - if("${info}" MATCHES "(.)I.N.F.O.:.") - string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}") - endif() if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]") if(COMPILER_ID) set(COMPILER_ID_TWICE 1) |