-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathfind-win-host.cmd
More file actions
executable file
·33 lines (25 loc) · 856 Bytes
/
find-win-host.cmd
File metadata and controls
executable file
·33 lines (25 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
rem This is a Windows cmd.exe script used to find windows host name.
rem %1 is the env. var to set to the windows host name.
setlocal
set NDK_ROOT=%~dp0
rem Check if %NDK_ROOT% contains any spaces
goto :L
:FOO
if "%2"=="" goto:EOF
echo ERROR: NDK path cannot contain any spaces!
exit /b 1
:L
call :FOO %NDK_ROOT%
if ERRORLEVEL 1 exit /b 1
set TEMP=windows-x86_64
rem Check if NDK_HOST_32BIT is not set to 1/true, Windows is 64-bit, and 64-bit make exists
if "%NDK_HOST_32BIT%"=="1" set TEMP=
if "%NDK_HOST_32BIT%"=="true" set TEMP=
if not exist "%NDK_ROOT%prebuilt\%TEMP%" set TEMP=
if "%ProgramW6432%"=="" if "%ProgramFiles(x86)%"=="" set TEMP=
rem Otherwise fall back to 32-bit make
if "%TEMP%"=="" set TEMP=windows
rem Uses "endlocal &&" hack to allow env. vars to survive setlocal/endlocal
endlocal && set "%1=%TEMP%"
exit /b 0