summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-08-08 17:44:25 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-08-08 17:44:25 (GMT)
commit8f1aaf28c13094f21a835a5b0fe47f7813179126 (patch)
treeb1fc78ac133d0995ca71946247bdd32c6bb41c5a /Source/cmLocalGenerator.cxx
parentc3a22c011d0febb1843f7848eb818b23bb567ac1 (diff)
downloadCMake-8f1aaf28c13094f21a835a5b0fe47f7813179126.zip
CMake-8f1aaf28c13094f21a835a5b0fe47f7813179126.tar.gz
CMake-8f1aaf28c13094f21a835a5b0fe47f7813179126.tar.bz2
ENH: make sure RuleVariable struct is initialized correctly, also make sure custom command targets do not crash cmake
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx41
1 files changed, 27 insertions, 14 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8447cb9..a251ee2 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -617,7 +617,11 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
vars.LinkLibraries = linkLibs.c_str();
vars.Flags = flags.c_str();
vars.LinkFlags = linkFlags.c_str();
-
+
+ std::string langFlags;
+ this->AddLanguageFlags(langFlags, llang, 0);
+ vars.LanguageCompileFlags = langFlags.c_str();
+
cmCustomCommandLines commandLines;
std::vector<std::string> rules;
rules.push_back(this->Makefile->GetRequiredDefinition(createRule.c_str()));
@@ -812,30 +816,39 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
return targetQuoted;
}
}
- if(variable == "LANGUAGE_COMPILE_FLAGS")
+ if(replaceValues.LanguageCompileFlags)
{
- return replaceValues.LanguageCompileFlags;
+ if(variable == "LANGUAGE_COMPILE_FLAGS")
+ {
+ return replaceValues.LanguageCompileFlags;
+ }
}
- if(variable == "TARGET")
+ if(replaceValues.Target)
{
- return replaceValues.Target;
+ if(variable == "TARGET")
+ {
+ return replaceValues.Target;
+ }
}
if(variable == "TARGET_IMPLIB")
{
return this->TargetImplib;
}
- if(variable == "TARGET_BASE")
+ if(replaceValues.Target)
{
- // Strip the last extension off the target name.
- std::string targetBase = replaceValues.Target;
- std::string::size_type pos = targetBase.rfind(".");
- if(pos != targetBase.npos)
+ if(variable == "TARGET_BASE")
{
+ // Strip the last extension off the target name.
+ std::string targetBase = replaceValues.Target;
+ std::string::size_type pos = targetBase.rfind(".");
+ if(pos != targetBase.npos)
+ {
return targetBase.substr(0, pos);
- }
- else
- {
- return targetBase;
+ }
+ else
+ {
+ return targetBase;
+ }
}
}
}