From 55db2cf1e59a2138992ae673db96c0a40f87324a Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Feb 2022 09:41:53 -0500 Subject: Makefiles: Fix "make depend" with add_custom_command DEPFILE Since commit cfd8a5ac1f (Makefiles: Add support of DEPFILE for add_custom_command, 2020-12-04, v3.20.0-rc1~237^2~1) we store in `CMAKE_DEPENDS_DEPENDENCY_FILES` an empty string as the source file with which the dependencies of a custom command depfile are associated. When this list is later expanded by `make depend`, the empty element is removed and breaks list indexing. Fix the list expansion to preserve empty elements. --- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 0f8cdca..e123cf9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1849,7 +1849,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf, cmSystemTools::Touch(DepTimestamp.GenericString(), true); // clear the dependencies files generated by the compiler - std::vector dependencies = cmExpandedList(depsFiles); + std::vector dependencies = cmExpandedList(depsFiles, true); cmDependsCompiler depsManager; depsManager.SetVerbose(verbose); depsManager.ClearDependencies(dependencies); -- cgit v0.12