From eed295fd8a84f4a4919acf2893053ad7e52e656d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 1 Feb 2023 09:11:30 -0500 Subject: cmGlobalNinjaGenerator: require that dependency info files work Now that only targets expected to have information are listed, all `Modules.json` files should exist. --- Source/cmGlobalNinjaGenerator.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index b80a06e..93aa30a 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2537,8 +2537,13 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( cmStrCat(linked_target_dir, '/', arg_lang, "Modules.json"); Json::Value ltm; cmsys::ifstream ltmf(ltmn.c_str(), std::ios::in | std::ios::binary); + if (!ltmf) { + cmSystemTools::Error(cmStrCat("-E cmake_ninja_dyndep failed to open ", + ltmn, " for module information")); + return false; + } Json::Reader reader; - if (ltmf && !reader.parse(ltmf, ltm, false)) { + if (!reader.parse(ltmf, ltm, false)) { cmSystemTools::Error(cmStrCat("-E cmake_ninja_dyndep failed to parse ", linked_target_dir, reader.getFormattedErrorMessages())); -- cgit v0.12