mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-18 22:08:28 -05:00
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.
This commit is contained in:
@@ -1849,7 +1849,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf,
|
|||||||
cmSystemTools::Touch(DepTimestamp.GenericString(), true);
|
cmSystemTools::Touch(DepTimestamp.GenericString(), true);
|
||||||
|
|
||||||
// clear the dependencies files generated by the compiler
|
// clear the dependencies files generated by the compiler
|
||||||
std::vector<std::string> dependencies = cmExpandedList(depsFiles);
|
std::vector<std::string> dependencies = cmExpandedList(depsFiles, true);
|
||||||
cmDependsCompiler depsManager;
|
cmDependsCompiler depsManager;
|
||||||
depsManager.SetVerbose(verbose);
|
depsManager.SetVerbose(verbose);
|
||||||
depsManager.ClearDependencies(dependencies);
|
depsManager.ClearDependencies(dependencies);
|
||||||
|
|||||||
Reference in New Issue
Block a user