Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d65a39d

Browse files
authored
Only write cmake_cmd_line.txt cache file if cmake succeeded (#93673)
I noticed that we wrote the cache file before invoking cmake, this meant that if the cmake configure step failed (e.g. because of an invalid command like in #93670) then running the build again would skip cmake configure, resulting in a broken build setup. This only applies to non-VS generators like ninja.
1 parent e1e18ee commit d65a39d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

eng/native/gen-buildsys.cmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ if not "%__ConfigureOnly%" == "1" (
101101
exit /B 0
102102
) else (
103103
echo The CMake command line differs from the last run. Running CMake again.
104-
echo %__ExtraCmakeParams% > %__CmdLineOptionsUpToDateFile%
105104
)
106-
) else (
107-
echo %__ExtraCmakeParams% > %__CmdLineOptionsUpToDateFile%
108105
)
109106
)
110107
)
@@ -114,6 +111,11 @@ if /i "%__UseEmcmake%" == "1" (
114111
) else (
115112
"%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
116113
)
114+
115+
if "%errorlevel%" == "0" (
116+
echo %__ExtraCmakeParams% > %__CmdLineOptionsUpToDateFile%
117+
)
118+
117119
endlocal
118120
exit /B %errorlevel%
119121

0 commit comments

Comments
 (0)