diff options
author | Brad King <brad.king@kitware.com> | 2016-12-02 15:47:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-06 13:58:37 (GMT) |
commit | 3bb2051eef5c3a07f99e9e6549187211758317d6 (patch) | |
tree | e1edc591c2ac2a2b7f8003af9c5587fe5d0124b3 /Source/cmMakefile.cxx | |
parent | 738a182a90dd29ce16376ab03a08c718b8068867 (diff) | |
download | CMake-3bb2051eef5c3a07f99e9e6549187211758317d6.zip CMake-3bb2051eef5c3a07f99e9e6549187211758317d6.tar.gz CMake-3bb2051eef5c3a07f99e9e6549187211758317d6.tar.bz2 |
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.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fecc983..a42c8c9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -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; |