mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user