summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-03 19:36:19 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-03 19:37:08 (GMT)
commit5cb66f17cadebd746d57cb95df67e9b3f327c4a1 (patch)
treef2cd9c6f1fe5928cd7577f1a25ecddcc0a41de14 /Modules/CMakeDetermineCompilerId.cmake
parent1ee99104f76ccd831713816eec588eb5d7e93f8b (diff)
downloadCMake-5cb66f17cadebd746d57cb95df67e9b3f327c4a1.zip
CMake-5cb66f17cadebd746d57cb95df67e9b3f327c4a1.tar.gz
CMake-5cb66f17cadebd746d57cb95df67e9b3f327c4a1.tar.bz2
CMakeDetermineCompilerId: Add whitespace to clarify logic
Also initialize a variable closer to its use.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index ca82d8a..d586275 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -752,10 +752,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
break()
endif()
endforeach()
- set(COMPILER_ID_TWICE)
+
# 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.
@@ -763,8 +764,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
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)
+
+ set(COMPILER_ID_TWICE)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
if(COMPILER_ID)