summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-07-11 21:29:27 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-07-11 21:29:27 (GMT)
commit16705a3e87f3f8a877b5fe8dc1e953c7abca4da3 (patch)
treeb0d172432a933f384da65b00d0ff031ff2f39b41 /Source/cmGlobalGenerator.cxx
parentbea1a5de771832463299146b4f2e4317c37f30bc (diff)
downloadCMake-16705a3e87f3f8a877b5fe8dc1e953c7abca4da3.zip
CMake-16705a3e87f3f8a877b5fe8dc1e953c7abca4da3.tar.gz
CMake-16705a3e87f3f8a877b5fe8dc1e953c7abca4da3.tar.bz2
COMP: revert last commit for now, broke Visual Studio
Alex
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx42
1 files changed, 11 insertions, 31 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 31adcf1..cea5b2b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -570,35 +570,12 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const char* l, cmMakefile* mf)
std::string linkerPrefVar = std::string("CMAKE_") +
std::string(l) + std::string("_LINKER_PREFERENCE");
const char* linkerPref = mf->GetDefinition(linkerPrefVar.c_str());
- int preference = 0;
- if(linkerPref)
+ if(!linkerPref)
{
- if (sscanf(linkerPref, "%d", &preference)!=1)
- {
- // backward compatibility: before 2.6 LINKER_PREFERENCE
- // was either "None" or "Prefered", and only the first character was
- // tested. So if there is a custom language out there and it is
- // "Prefered", set its preference high
- if (linkerPref[0]=='P')
- {
- preference = 100;
- }
- else
- {
- preference = 0;
- }
- }
+ linkerPref = "None";
}
+ this->LanguageToLinkerPreference[l] = linkerPref;
- if (preference < 0)
- {
- std::string msg = linkerPrefVar;
- msg += " is negative, adjusting it to 0";
- cmSystemTools::Message(msg.c_str(), "Warning");
- preference = 0;
- }
-
- this->LanguageToLinkerPreference[l] = preference;
std::string outputExtensionVar = std::string("CMAKE_") +
std::string(l) + std::string("_OUTPUT_EXTENSION");
@@ -775,6 +752,10 @@ void cmGlobalGenerator::Configure()
}
notFoundVars += "\n";
}
+ cmSystemTools::Error("This project requires some variables to be set,\n"
+ "and cmake can not find them.\n"
+ "Please set the following variables:\n",
+ notFoundVars.c_str());
}
// at this point this->LocalGenerators has been filled,
// so create the map from project name to vector of local generators
@@ -1139,14 +1120,13 @@ void cmGlobalGenerator::GetEnabledLanguages(std::vector<std::string>& lang)
}
}
-int cmGlobalGenerator::GetLinkerPreference(const char* lang)
+const char* cmGlobalGenerator::GetLinkerPreference(const char* lang)
{
- std::map<cmStdString, int>::const_iterator it = this->LanguageToLinkerPreference.find(lang);
- if (it != this->LanguageToLinkerPreference.end())
+ if(this->LanguageToLinkerPreference.count(lang))
{
- return it->second;
+ return this->LanguageToLinkerPreference[lang].c_str();
}
- return 0;
+ return "None";
}
void cmGlobalGenerator::FillProjectMap()