diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-27 14:53:01 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-27 14:53:01 (GMT) |
commit | 36c8f1d15792192790f0841d5658a105f44b420b (patch) | |
tree | 488e5dcf19787ed344fb62e7724964b6d899f393 /Source/cmLocalGenerator.cxx | |
parent | 56234aed4bfc87b691897056c4535b4d8cb3098f (diff) | |
download | CMake-36c8f1d15792192790f0841d5658a105f44b420b.zip CMake-36c8f1d15792192790f0841d5658a105f44b420b.tar.gz CMake-36c8f1d15792192790f0841d5658a105f44b420b.tar.bz2 |
ENH: put error checking for missing linker languages
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 5b72a80..a454e52 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -598,6 +598,12 @@ void cmLocalGenerator::CreateCustomTargetsAndCommands(std::set<cmStdString> cons case cmTarget::EXECUTABLE: { const char* llang = target.GetLinkerLanguage(this->GetGlobalGenerator()); + if(!llang) + { + cmSystemTools::Error("CMake can not determine linker language for target:", + target.GetName()); + return; + } // if the language is not in the set lang then create custom // commands to build the target if(lang.count(llang) == 0) @@ -988,6 +994,12 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, linkFlags += " "; } const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator()); + if(!linkLanguage) + { + cmSystemTools::Error("CMake can not determine linker language for target:", + target.GetName()); + return; + } std::string langVar = "CMAKE_"; langVar += linkLanguage; std::string flagsVar = langVar + "_FLAGS"; @@ -1056,6 +1068,12 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout, buildType = cmSystemTools::UpperCase(buildType); const char* linkLanguage = tgt.GetLinkerLanguage(this->GetGlobalGenerator()); + if(!linkLanguage) + { + cmSystemTools::Error("CMake can not determine linker language for target:", + tgt.GetName()); + return; + } std::string runTimeFlagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_"; runTimeFlagVar += linkLanguage; runTimeFlagVar += "_FLAG"; |