summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-12-16 14:15:18 (GMT)
committerBrad King <brad.king@kitware.com>2008-12-16 14:15:18 (GMT)
commit205fce61b66df1898a45fe49195101d7236790d5 (patch)
tree68cd5a7ad1b757870cf1a275044a36348516255b /Source
parent3cf9265fa7d1f6c7753ae5f19947409e4d9b8e9c (diff)
downloadCMake-205fce61b66df1898a45fe49195101d7236790d5.zip
CMake-205fce61b66df1898a45fe49195101d7236790d5.tar.gz
CMake-205fce61b66df1898a45fe49195101d7236790d5.tar.bz2
ENH: Warn if build dir is too long for filesystem
When an object file directory is too deep to place an object file without exceeding CMAKE_OBJECT_PATH_MAX, this issues a warning. Previously we silently ignored the problem. See issue #7860.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx23
-rw-r--r--Source/cmLocalGenerator.h1
2 files changed, 22 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d5260a9..b2132f1 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -136,6 +136,7 @@ void cmLocalGenerator::Configure()
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
}
+ this->ObjectMaxPathViolations.clear();
}
this->Configured = true;
@@ -2536,8 +2537,26 @@ cmLocalGenerator
}
#if defined(CM_LG_ENCODE_OBJECT_NAMES)
- cmLocalGeneratorCheckObjectName(ssin, dir_max.size(),
- this->ObjectPathMax);
+ if(!cmLocalGeneratorCheckObjectName(ssin, dir_max.size(),
+ this->ObjectPathMax))
+ {
+ // Warn if this is the first time the path has been seen.
+ if(this->ObjectMaxPathViolations.insert(dir_max).second)
+ {
+ cmOStringStream m;
+ m << "The object file directory\n"
+ << " " << dir_max << "\n"
+ << "has " << dir_max.size() << " characters. "
+ << "The maximum full path to an object file is "
+ << this->ObjectPathMax << " characters "
+ << "(see CMAKE_OBJECT_PATH_MAX). "
+ << "Object file\n"
+ << " " << ssin << "\n"
+ << "cannot be safely placed under this directory. "
+ << "The build may not work correctly.";
+ this->Makefile->IssueMessage(cmake::WARNING, m.str());
+ }
+ }
#else
(void)dir_max;
#endif
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 0f4c1e9..5f962ad 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -370,6 +370,7 @@ protected:
std::map<cmStdString, cmStdString> LanguageToIncludeFlags;
std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
std::string::size_type ObjectPathMax;
+ std::set<cmStdString> ObjectMaxPathViolations;
bool WindowsShell;
bool WindowsVSIDE;
bool WatcomWMake;