Commit f25ac39d authored by Brad King's avatar Brad King 💬
Browse files

CMakeDetermineCompilerId: Tolerate stray text around INFO strings

When cross-compiling with Xcode our compiler id test binary may be
compiled with multiple architectures.  The INFO strings should be
identical and therefore de-duplicated.  However, this can be broken by
stray text that happens to sit immediately before or after an INFO
string.  Filter out such text so we can match clean INFO strings.

Fixes: #21526
parent 5cb66f17
Pipeline #203445 passed with stage
in 0 seconds
......@@ -765,6 +765,10 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
CMAKE_${lang}_COMPILER_ID_STRINGS "${CMAKE_${lang}_COMPILER_ID_STRINGS}")
endif()
# Remove arbitrary text that may appear before or after each INFO string.
string(REGEX MATCHALL "INFO:[A-Za-z0-9_]+\\[([^]\"]*)\\]"
CMAKE_${lang}_COMPILER_ID_STRINGS "${CMAKE_${lang}_COMPILER_ID_STRINGS}")
# In C# binaries, some strings are found more than once.
list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_ID_STRINGS)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment