Commit 7e3441b3
7e3441b3e19eMerged
bamchoh <[email protected]> · 7 months ago · 1 file · ~1 modified
Description
Avoid leading spaces in EXTRA_FLAGS
Address gemini-code-assist review on PR matz#23:
- Ensure SP_RT_LIB is appended without introducing a leading space.
- Also apply the same handling to -lonig, which had the same issue when EXTRA_FLAGS was initially empty.
Co-authored-by: Copilot [email protected]
Details
- Commit
- 7e3441b3e19e
- Parent
- eed41533fff3
spinel.batmodifiedView file
@@ -39,7 +39,13 @@
3939
if /i "%~1"=="-O" (set "OPT_LEVEL=%~2" & shift & shift & goto parse)4040
if /i "%~1"=="-c" (set "C_ONLY=1" & shift & goto parse)4141
if /i "%~1"=="-S" (set "STDOUT_MODE=1" & shift & goto parse)42-
if /i "%~1"=="--lonig" (set "EXTRA_FLAGS=%EXTRA_FLAGS% -lonig" & shift & goto parse)42+
if /i "%~1"=="--lonig" (43+
if defined EXTRA_FLAGS (44+
set "EXTRA_FLAGS=%EXTRA_FLAGS% -lonig"45+
) else (46+
set "EXTRA_FLAGS=-lonig"47+
) & shift & goto parse48+
)4349
set "_a=%~1"4450
if "%_a:~0,5%"=="--cc=" (set "CC_CMD=%_a:~5%" & shift & goto parse)4551
if not defined SOURCE set "SOURCE=%~1"@@ -122,7 +128,13 @@
122128
123129
set "SP_RT_LIB=%DIR%\lib\libspinel_rt.a"124130
set "INCLUDE_FLAGS=-I"%DIR%\lib" -I"%DIR%\lib\regexp""125-
if exist "%SP_RT_LIB%" set "EXTRA_FLAGS=%EXTRA_FLAGS% "%SP_RT_LIB%""131+
if exist "%SP_RT_LIB%" (132+
if defined EXTRA_FLAGS (133+
set "EXTRA_FLAGS=%EXTRA_FLAGS% "%SP_RT_LIB%""134+
) else (135+
set "EXTRA_FLAGS="%SP_RT_LIB%""136+
)137+
)126138
127139
%CC_CMD% -O%OPT_LEVEL% -Wno-all -ffunction-sections -fdata-sections %INCLUDE_FLAGS% "%C_FILE%" -lm %EXTRA_FLAGS% -Wl,--gc-sections -Wl,--stack,67108864 -o "%BIN_FILE%"128140
set "EC=%ERRORLEVEL%"