Improve postbuild path search

Before, it would find the first instance of "msvc" in the directory
path, but since I happen to be using this repository within another
"*msvc*" directory, it was not using the correct path within the
repository itself! This ensures that the last instance of "msvc" is used,
which will definitely be within the repository.
This commit is contained in:
Paul 'Nick' Laurenzano 2020-04-08 08:22:13 -04:00
parent 6be0d67dde
commit d28ac1d5ce

View File

@ -5,11 +5,20 @@ rem %2 = last two digits of the Visual Studio version number (e.g. 17)
set vs_ver=%2 set vs_ver=%2
set str=%~1 set str=%~1
rem delete anything from the path before 'msvc' rem delete anything from the path before the FINAL 'msvc'
:dele :dele
set str=%str:~1% set str=%str:~1%
set str2=%str:~0,4% set str2=%str:~0,4%
if "%str2%" NEQ "msvc" goto dele
if "%str%" EQU "" (
goto dele_done
) else if "%str2%" EQU "msvc" (
set str_confirmed=%str%
)
goto dele
:dele_done
set str=%str_confirmed%
echo "Final subpath %str%"
rem we now have: msvc.\vs<nn>\<project_directory>\<win32|x64>\<debug|release>\mpir.<lib|dll> rem we now have: msvc.\vs<nn>\<project_directory>\<win32|x64>\<debug|release>\mpir.<lib|dll>
rem extract: project_directory, platform (plat=<win32|x64>), configuration (conf=<debug|release>) and file name rem extract: project_directory, platform (plat=<win32|x64>), configuration (conf=<debug|release>) and file name