|
2 | 2 | set rt= |
3 | 3 | set rtver= |
4 | 4 | set osver= |
5 | | -for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<msvcr.*\.dll$"`) do set rt=%%~nI |
6 | | -if "%rt%" NEQ "" goto :msvcr |
7 | | -for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<vcruntime.*\.dll$"`) do set rt=%%~nI |
8 | | -if "%rt%" NEQ "" goto :vcruntime |
| 5 | +for /f "usebackq" %%I in (` |
| 6 | + dumpbin -dependents %1 ^| |
| 7 | + findstr -r -i -c:"\<vcruntime.*\.dll$" -c:"\<msvcr.*\.dll$" |
| 8 | +`) do ( |
| 9 | + set rt=%%~nI |
| 10 | +) |
9 | 11 |
|
10 | | -(echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2 |
11 | | -exit 1 |
| 12 | +for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @( |
| 13 | + ::- downcase |
| 14 | + call set rt=%%rt:%%i=%%i%% |
| 15 | +) |
12 | 16 |
|
13 | | -:msvcr |
14 | | -for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @call set rt=%%rt:%%i=%%i%% |
15 | 17 | if "%rt%" == "msvcrt" ( |
16 | 18 | call set rtver=60 |
17 | | -) else ( |
| 19 | +) else if "%rt:~0,5%" == "msvcr" ( |
18 | 20 | call set rtver=%%rt:msvcr=%% |
19 | | - call set rt=msvcr%%rtver%% |
20 | 21 | call set osver=_%%rtver%% |
| 22 | +) else if "%rt:~0,9%" == "vcruntime" ( |
| 23 | + call set rtver=%%rt:vcruntime=%% |
| 24 | + call set osver=_%%rtver%% |
| 25 | +) else ( |
| 26 | + (echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2 |
| 27 | + exit 1 |
| 28 | +) |
| 29 | +for %%I in ( |
| 30 | + "PLATFORM = $(TARGET_OS)%osver%" |
| 31 | + "RT = %rt%" |
| 32 | + "RT_VER = %rtver%" |
| 33 | +) do @( |
| 34 | + echo %%~I |
21 | 35 | ) |
22 | | -goto :exit |
23 | | - |
24 | | -:vcruntime |
25 | | -for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @call set rt=%%rt:%%i=%%i%% |
26 | | -call set rtver=%%rt:vcruntime=%% |
27 | | -call set rt=vcruntime%%rtver%% |
28 | | -call set osver=_%%rtver%% |
29 | | - |
30 | | -:exit |
31 | | -for %%I in ("PLATFORM = $(TARGET_OS)%osver%" "RT = %rt%" "RT_VER = %rtver%") do @echo %%~I |
|
0 commit comments