mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Ninja: Fix detection of MSVC showIncludes prefix in Italian
The prefix does not have two colons. Update our regex. Fixes: #24357
This commit is contained in:
@@ -1144,7 +1144,7 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags)
|
||||
ENCODING AUTO # cl prints in console output code page
|
||||
)
|
||||
string(REPLACE "\n" "\n " msg " ${out}")
|
||||
if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n]*:[^:\n]*:[ \t]*)")
|
||||
if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n][^:\n]+:[^:\n]*[^: \n][^: \n]:?[ \t]+)[A-Za-z]:\\\\")
|
||||
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)
|
||||
string(APPEND msg "\nFound prefix \"${CMAKE_MATCH_2}\"")
|
||||
else()
|
||||
|
||||
@@ -49,6 +49,7 @@ if(WIN32)
|
||||
run_cmake_script(ShowIncludes-437-English -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
run_cmake_script(ShowIncludes-437-French -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
run_cmake_script(ShowIncludes-437-German -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
run_cmake_script(ShowIncludes-437-Italian -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
run_cmake_script(ShowIncludes-54936-Chinese -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
run_cmake_script(ShowIncludes-65001-Chinese -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
run_cmake_script(ShowIncludes-65001-French -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM})
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# 'cl /showIncludes' prefix with 'VSLANG=1040' and 'chcp 437'.
|
||||
set(expect "Nota: file incluso ")
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake)
|
||||
1
Tests/RunCMake/Ninja/ShowIncludes-437-Italian-stdout.txt
Normal file
1
Tests/RunCMake/Ninja/ShowIncludes-437-Italian-stdout.txt
Normal file
@@ -0,0 +1 @@
|
||||
-- showIncludes='Nota: file incluso '
|
||||
3
Tests/RunCMake/Ninja/ShowIncludes-437-Italian.cmake
Normal file
3
Tests/RunCMake/Ninja/ShowIncludes-437-Italian.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
set(CODEPAGE 437)
|
||||
set(VSLANG 1040)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake)
|
||||
@@ -53,6 +53,13 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(vslang, "1040") == 0) {
|
||||
if (cp == 437 || cp == 65001) {
|
||||
printf("Nota: file incluso C:\\foo.h\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(vslang, "1041") == 0) {
|
||||
if (cp == 932) {
|
||||
printf("\x83\x81\x83\x82: "
|
||||
|
||||
Reference in New Issue
Block a user