summaryrefslogtreecommitdiff
path: root/win32/rtname.cmd
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-14 08:13:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-14 08:13:18 +0000
commit4ba1038af3e95471350d67a8a82d509865189b35 (patch)
tree9bcd9ccbbea2f9fa01345dd9f67f7c00e0dabfa9 /win32/rtname.cmd
parentf77967ad73521b0b8fa7128f9aba0fcad57c5b9b (diff)
rtname.cmd: extract at once
* win32/rtname.cmd: extract runtime DLL names at once, and other refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/rtname.cmd')
-rw-r--r--win32/rtname.cmd44
1 files changed, 24 insertions, 20 deletions
diff --git a/win32/rtname.cmd b/win32/rtname.cmd
index f7a52b8..775e816 100644
--- a/win32/rtname.cmd
+++ b/win32/rtname.cmd
@@ -2,30 +2,34 @@
set rt=
set rtver=
set osver=
-for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<msvcr.*\.dll$"`) do set rt=%%~nI
-if "%rt%" NEQ "" goto :msvcr
-for /f "usebackq" %%I in (`dumpbin -dependents %1 ^| findstr -r -i "\<vcruntime.*\.dll$"`) do set rt=%%~nI
-if "%rt%" NEQ "" goto :vcruntime
+for /f "usebackq" %%I in (`
+ dumpbin -dependents %1 ^|
+ findstr -r -i -c:"\<vcruntime.*\.dll$" -c:"\<msvcr.*\.dll$"
+`) do (
+ set rt=%%~nI
+)
-(echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2
-exit 1
+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 @(
+ ::- downcase
+ call set rt=%%rt:%%i=%%i%%
+)
-:msvcr
-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%%
if "%rt%" == "msvcrt" (
call set rtver=60
-) else (
+) else if "%rt:~0,5%" == "msvcr" (
call set rtver=%%rt:msvcr=%%
- call set rt=msvcr%%rtver%%
call set osver=_%%rtver%%
+) else if "%rt:~0,9%" == "vcruntime" (
+ call set rtver=%%rt:vcruntime=%%
+ call set osver=_%%rtver%%
+) else (
+ (echo %0: %1 is not linked to msvcrt nor vcruntime) 1>&2
+ exit 1
+)
+for %%I in (
+ "PLATFORM = $(TARGET_OS)%osver%"
+ "RT = %rt%"
+ "RT_VER = %rtver%"
+) do @(
+ echo %%~I
)
-goto :exit
-
-:vcruntime
-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%%
-call set rtver=%%rt:vcruntime=%%
-call set rt=vcruntime%%rtver%%
-call set osver=_%%rtver%%
-
-:exit
-for %%I in ("PLATFORM = $(TARGET_OS)%osver%" "RT = %rt%" "RT_VER = %rtver%") do @echo %%~I