summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-12 11:24:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-07-12 11:24:52 (GMT)
commitf9e0cf64176628d07871741da2c6f585f52c4e39 (patch)
treef89db6fe4624fc5ed5b3087ac2860bb14f6abbf5
parent207a48602a32f762e2bbe4eef75e6ff4bdb4945c (diff)
parentd1f38ba65d7a6860ceac0d60dc77971e9ccfdd05 (diff)
downloadCMake-f9e0cf64176628d07871741da2c6f585f52c4e39.zip
CMake-f9e0cf64176628d07871741da2c6f585f52c4e39.tar.gz
CMake-f9e0cf64176628d07871741da2c6f585f52c4e39.tar.bz2
Merge topic 'compiler-id-encoding'
d1f38ba65d CMakeDetermineCompilerId: Consider UTF-16 encodings of INFO strings Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3539
-rw-r--r--Modules/CMakeDetermineCSharpCompiler.cmake1
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake12
2 files changed, 8 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake
index dab9414..da860a8 100644
--- a/Modules/CMakeDetermineCSharpCompiler.cmake
+++ b/Modules/CMakeDetermineCSharpCompiler.cmake
@@ -18,7 +18,6 @@ if(NOT CMAKE_CSharp_COMPILER_ID_RUN)
set(CMAKE_CSharp_COMPILER_ID_RUN 1)
# Try to identify the compiler.
- set(CMAKE_CSharp_COMPILER_ID_STRINGS_PARAMETERS ENCODING UTF-16LE)
set(CMAKE_CSharp_COMPILER_ID)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(CSharp CSFLAGS CMakeCSharpCompilerId.cs)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 6083358..1914f52 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -640,10 +640,14 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(ARCHITECTURE_ID)
set(SIMULATE_ID)
set(SIMULATE_VERSION)
- file(STRINGS ${file}
- CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38
- ${CMAKE_${lang}_COMPILER_ID_STRINGS_PARAMETERS}
- REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
+ foreach(encoding "" "ENCODING;UTF-16LE" "ENCODING;UTF-16BE")
+ file(STRINGS "${file}" CMAKE_${lang}_COMPILER_ID_STRINGS
+ LIMIT_COUNT 38 ${encoding}
+ REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
+ if(NOT CMAKE_${lang}_COMPILER_ID_STRINGS STREQUAL "")
+ 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.