Skip to content

Commit 98fee0d

Browse files
Add some sanity checks to the mrbind bat scripts, to prevent them fro… (#5830)
* Add some sanity checks to the mrbind bat scripts, to prevent them from being ran from the VS dev prompt. * Explain why we don't want the scripts to run from the VS dev prompt.
1 parent 9ab0495 commit 98fee0d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

scripts/mrbind/install_deps_windows_msys2.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ rem some other MSYS2 copy.
99

1010
setlocal
1111

12+
rem Make sure we're not running from the VS dev prompt.
13+
rem Doing this just in case. `scripts/mrbind/install_mrbind_windows_msys2.bat` is known not to work there,
14+
rem but this script could possibly work. But it's easier to not support this.
15+
if not "%VCToolsInstallDir%" == "" (
16+
echo Must not run this script from the VS developer command prompt. Use the regular terminal.
17+
exit /b 1
18+
)
19+
1220
if "%MSYS2_DIR%" == "" set MSYS2_DIR=C:\msys64_meshlib_mrbind
1321
if "%CLANG_VER%" == "" set /p CLANG_VER=<%~dp0\clang_version_msys2.txt
1422

scripts/mrbind/install_mrbind_windows_msys2.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ setlocal
88
rem Push enable extensions (for `mkdir` to behave like Linux `mkdir -p`).
99
setlocal enableextensions
1010

11+
rem Make sure we're not running from the VS dev prompt. It's known to break MRBind builds,
12+
rem because it somehow forces MSYS2 CMake to use Vcpkg. Possibly via an env variable, I didn't investiate further.
13+
if not "%VCToolsInstallDir%" == "" (
14+
echo Must not run this script from the VS developer command prompt. Use the regular terminal.
15+
exit /b 1
16+
)
17+
1118
if "%MSYS2_DIR%" == "" set MSYS2_DIR=C:\msys64_meshlib_mrbind
1219

1320
if "%MRBIND_DIR%" == "" set MRBIND_DIR=%~dp0\..\..\thirdparty\mrbind

0 commit comments

Comments
 (0)