summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-11-21 16:23:14 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-11-21 16:29:38 (GMT)
commit7ae7d6650344f7a36216af8424abbf0b834688d1 (patch)
treeece7ac19df2fda8868a9f8eee3682135f0176d44 /Source/cmLocalGenerator.cxx
parent078e35defbe6e0ee3b216dd2e83ca85d49920fc3 (diff)
downloadCMake-7ae7d6650344f7a36216af8424abbf0b834688d1.zip
CMake-7ae7d6650344f7a36216af8424abbf0b834688d1.tar.gz
CMake-7ae7d6650344f7a36216af8424abbf0b834688d1.tar.bz2
NMake: Fix problem with empty DEPENDS args (#13392)
add_custom_command can have empty DEPENDS arguments, which was triggering invalid makefile generation for the NMake Makefiles generator. We were mistakenly emitting the build directory appended with "/" plus the empty string... which was then translated to a string ending in \" in build.make... which nmake choked on. The solution is not to emit any dependency when the input DEPENDS is the empty string. Return early from GetRealDependency in this empty input case.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4952a8c..d48f43a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1875,6 +1875,14 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
// modify the name so stripping down to just the file name should
// produce the target name in this case.
std::string name = cmSystemTools::GetFilenameName(inName);
+
+ // If the input name is the empty string, there is no real
+ // dependency. Short-circuit the other checks:
+ if(name == "")
+ {
+ return false;
+ }
+
if(cmSystemTools::GetFilenameLastExtension(name) == ".exe")
{
name = cmSystemTools::GetFilenameWithoutLastExtension(name);