Skip to content

Commit 2635642

Browse files
committed
build, tools, win: update nasm detection
Logs the NASM path when it found.
1 parent faada65 commit 2635642

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tools/msvs/find_nasm.cmd

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
@IF NOT DEFINED DEBUG_HELPER @ECHO OFF
22

3-
ECHO Looking for NASM
3+
echo Looking for NASM
44

5-
FOR /F "delims=" %%a IN ('where nasm 2^> NUL') DO (
6-
EXIT /B 0
5+
for /f "delims=" %%a IN ('where nasm 2^> NUL') DO (
6+
echo NASM found in %%a
7+
exit /b 0
78
)
89

9-
IF EXIST "%ProgramFiles%\NASM\nasm.exe" (
10-
SET "Path=%Path%;%ProgramFiles%\NASM"
11-
EXIT /B 0
10+
for %%a in ("%ProgramFiles%\NASM\nasm.exe" "%ProgramFiles(x86)%\NASM\nasm.exe" "%LOCALAPPDATA%\bin\NASM\nasm.exe") do (
11+
if exist %%a (
12+
call :find-nasm %%a
13+
exit /b 0
14+
)
1215
)
16+
exit /b 1
1317

14-
IF EXIST "%ProgramFiles(x86)%\NASM\nasm.exe" (
15-
SET "Path=%Path%;%ProgramFiles(x86)%\NASM"
16-
EXIT /B 0
17-
)
18-
19-
if EXIST "%LOCALAPPDATA%\bin\NASM\nasm.exe" (
20-
SET "Path=%Path%;%LOCALAPPDATA%\bin\NASM"
21-
EXIT /B 0
22-
)
23-
24-
EXIT /B 1
18+
:find-nasm
19+
set p=%~1
20+
set p=%p:~0,-9%
21+
set "Path=%Path%;%p%"
22+
set p=
23+
echo NASM found in %~1
24+
exit /b 0

0 commit comments

Comments
 (0)