diff options
author | Brad King <brad.king@kitware.com> | 2018-03-09 12:43:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-03-09 12:43:54 (GMT) |
commit | e11410bb0c66152c6fafb56d40c9328abaa7a1ab (patch) | |
tree | 14113116753b98ab5b0932ab87c3092756d6f295 /Source/cmMakefile.cxx | |
parent | 44fc5729637330e463666f97ba952dcb6f2e9506 (diff) | |
parent | 5901699672cce82d9622a02c4c7d22889029ee0c (diff) | |
download | CMake-e11410bb0c66152c6fafb56d40c9328abaa7a1ab.zip CMake-e11410bb0c66152c6fafb56d40c9328abaa7a1ab.tar.gz CMake-e11410bb0c66152c6fafb56d40c9328abaa7a1ab.tar.bz2 |
Merge topic 'cmWorkingDirectory_success_checking'
5901699672 cmDepends: Remove attempt to change directory that always fails
e60e4dfc88 cmWorkingDirectory: Check success of current dir changes
e654622aee Tests: Add --build-and-test test case
a865f0beb2 Tests: Confirm test working dir set successfully
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1817
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a69f75f..9e53579 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -6,12 +6,12 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> #include <assert.h> +#include <cstring> #include <ctype.h> #include <iterator> #include <memory> // IWYU pragma: keep #include <sstream> #include <stdlib.h> -#include <string.h> #include <utility> #include "cmAlgorithms.h" @@ -3250,6 +3250,14 @@ int cmMakefile::TryCompile(const std::string& srcdir, // change to the tests directory and run cmake // use the cmake object instead of calling cmake cmWorkingDirectory workdir(bindir); + if (workdir.Failed()) { + this->IssueMessage(cmake::FATAL_ERROR, + "Failed to set working directory to " + bindir + " : " + + std::strerror(workdir.GetLastResult())); + cmSystemTools::SetFatalErrorOccured(); + this->IsSourceFileTryCompile = false; + return 1; + } // make sure the same generator is used // use this program as the cmake to be run, it should not |