summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-08-19 14:13:04 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-08-19 14:13:04 (GMT)
commit8d8c3be72bf03816ed8c273d59061b862ae27075 (patch)
tree16a3c455d8c06d0981ff45e2f5091b855f0278af
parent904305e3cba9c03d98160a1667ec7500e6841e6b (diff)
downloadCMake-8d8c3be72bf03816ed8c273d59061b862ae27075.zip
CMake-8d8c3be72bf03816ed8c273d59061b862ae27075.tar.gz
CMake-8d8c3be72bf03816ed8c273d59061b862ae27075.tar.bz2
BUG: If the scanner is not defined this would crash. For example when using new language
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f397106..fc05201 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2830,26 +2830,26 @@ cmLocalUnixMakefileGenerator3
}
#endif
- // for each file we need to scan
- std::string srcLang = "CMAKE_DEPENDS_CHECK_";
- srcLang += lang;
- const char *srcStr = mf->GetSafeDefinition(srcLang.c_str());
- std::vector<std::string> srcs;
- cmSystemTools::ExpandListArgument(srcStr, srcs);
- for (std::vector<std::string>::iterator si =
- srcs.begin(); si != srcs.end(); ++si)
- {
- std::string &src = *si;
- ++si;
- // make sure the object file is relative to home output
- std::string obj = *si;
- obj = lg->Convert(obj.c_str(),HOME_OUTPUT,MAKEFILE);
- scanner->Write(src.c_str(),obj.c_str(),ruleFileStream);
- }
-
- // free the scanner for this language
if (scanner)
{
+ // for each file we need to scan
+ std::string srcLang = "CMAKE_DEPENDS_CHECK_";
+ srcLang += lang;
+ const char *srcStr = mf->GetSafeDefinition(srcLang.c_str());
+ std::vector<std::string> srcs;
+ cmSystemTools::ExpandListArgument(srcStr, srcs);
+ for (std::vector<std::string>::iterator si =
+ srcs.begin(); si != srcs.end(); ++si)
+ {
+ std::string &src = *si;
+ ++si;
+ // make sure the object file is relative to home output
+ std::string obj = *si;
+ obj = lg->Convert(obj.c_str(),HOME_OUTPUT,MAKEFILE);
+ scanner->Write(src.c_str(),obj.c_str(),ruleFileStream);
+ }
+
+ // free the scanner for this language
delete scanner;
}
}