WINDOWS_EXPORT_ALL_SYMBOLS: Fail explicitly if nm fails to start

Previously, when process creation failed, the initialized exit code
remained zero and `__create_def` silently wrote an empty export file.

Closes: #27993
This commit is contained in:
Chuck Atkins
2026-08-05 10:58:20 -04:00
parent 03e56cd338
commit ca1dc92e36
+4 -3
View File
@@ -371,10 +371,11 @@ static bool DumpFileWithLlvmNm(std::string const& nmPath, char const* filename,
// run the command
int exit_code = 0;
cmSystemTools::RunSingleCommand(command, &output, &output, &exit_code,
nullptr, cmSystemTools::OUTPUT_NONE);
bool const commandResult =
cmSystemTools::RunSingleCommand(command, &output, &output, &exit_code,
nullptr, cmSystemTools::OUTPUT_NONE);
if (exit_code != 0) {
if (!commandResult || exit_code != 0) {
fprintf(stderr, "llvm-nm returned an error: %s\n", output.c_str());
return false;
}