mirror of
https://github.com/reactos/CMake.git
synced 2025-03-05 18:37:46 +00:00
try_compile: Stop processing when test build system fails to generate
Failing to generate the build system of the test project is a failure to compute the result of the test compilation, and so must be treated as any other CMake Error and stop processing.
This commit is contained in:
parent
738a182a90
commit
3bb2051eef
@ -3158,8 +3158,10 @@ int cmMakefile::TryCompile(const std::string& srcdir,
|
||||
cmGlobalGenerator* gg =
|
||||
cm.CreateGlobalGenerator(this->GetGlobalGenerator()->GetName());
|
||||
if (!gg) {
|
||||
cmSystemTools::Error(
|
||||
"Internal CMake error, TryCompile bad GlobalGenerator");
|
||||
this->IssueMessage(cmake::INTERNAL_ERROR, "Global generator '" +
|
||||
this->GetGlobalGenerator()->GetName() +
|
||||
"' could not be created.");
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
// return to the original directory
|
||||
cmSystemTools::ChangeDirectory(cwd);
|
||||
this->IsSourceFileTryCompile = false;
|
||||
@ -3222,8 +3224,9 @@ int cmMakefile::TryCompile(const std::string& srcdir,
|
||||
cmStateEnums::INTERNAL);
|
||||
}
|
||||
if (cm.Configure() != 0) {
|
||||
cmSystemTools::Error(
|
||||
"Internal CMake error, TryCompile configure of cmake failed");
|
||||
this->IssueMessage(cmake::FATAL_ERROR,
|
||||
"Failed to configure test project build system.");
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
// return to the original directory
|
||||
cmSystemTools::ChangeDirectory(cwd);
|
||||
this->IsSourceFileTryCompile = false;
|
||||
@ -3231,8 +3234,9 @@ int cmMakefile::TryCompile(const std::string& srcdir,
|
||||
}
|
||||
|
||||
if (cm.Generate() != 0) {
|
||||
cmSystemTools::Error(
|
||||
"Internal CMake error, TryCompile generation of cmake failed");
|
||||
this->IssueMessage(cmake::FATAL_ERROR,
|
||||
"Failed to generate test project build system.");
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
// return to the original directory
|
||||
cmSystemTools::ChangeDirectory(cwd);
|
||||
this->IsSourceFileTryCompile = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user