summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-13 12:11:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-05-13 12:11:25 (GMT)
commitda6fd5842d680c21365302f743940141080b008d (patch)
tree58ce7ef2496b80e4541bf563a836f3f31c565e20 /Source
parent049d388cfa73bf034655dcb976fa059d29ab7abc (diff)
parent3a7153440282148233c7dff33538fd3b46a3175d (diff)
downloadCMake-da6fd5842d680c21365302f743940141080b008d.zip
CMake-da6fd5842d680c21365302f743940141080b008d.tar.gz
CMake-da6fd5842d680c21365302f743940141080b008d.tar.bz2
Merge topic 'ninja-fortran-symlink'
3a71534402 Ninja: Restore support for Fortran in a symlinked build tree Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6120
Diffstat (limited to 'Source')
-rw-r--r--Source/cmScanDepFormat.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmScanDepFormat.cxx b/Source/cmScanDepFormat.cxx
index e046069..f988fe4 100644
--- a/Source/cmScanDepFormat.cxx
+++ b/Source/cmScanDepFormat.cxx
@@ -69,7 +69,7 @@ static Json::Value EncodeFilename(std::string const& path)
return false; \
} \
\
- if (!cmSystemTools::FileIsFullPath(res)) { \
+ if (!work_directory.empty() && !cmSystemTools::FileIsFullPath(res)) { \
res = cmStrCat(work_directory, '/', res); \
} \
} while (0)
@@ -105,15 +105,16 @@ bool cmScanDepFormat_P1689_Parse(std::string const& arg_pp, cmSourceInfo* info)
}
for (auto const& rule : rules) {
+ std::string work_directory;
Json::Value const& workdir = rule["work-directory"];
- if (!workdir.isString()) {
+ if (workdir.isString()) {
+ PARSE_BLOB(workdir, work_directory);
+ } else if (!workdir.isNull()) {
cmSystemTools::Error(cmStrCat("-E cmake_ninja_dyndep failed to parse ",
arg_pp,
": work-directory is not a string"));
return false;
}
- std::string work_directory;
- PARSE_BLOB(workdir, work_directory);
Json::Value const& depends = rule["depends"];
if (depends.isArray()) {
@@ -203,8 +204,6 @@ bool cmScanDepFormat_P1689_Write(std::string const& path,
Json::Value& rules = ddi["rules"] = Json::arrayValue;
Json::Value rule(Json::objectValue);
- rule["work-directory"] =
- EncodeFilename(cmSystemTools::GetCurrentWorkingDirectory());
Json::Value& inputs = rule["inputs"] = Json::arrayValue;
inputs.append(EncodeFilename(input));