summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx72
1 files changed, 54 insertions, 18 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 978f00e..5a3c238 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -11,6 +11,9 @@
============================================================================*/
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "windows.h" // this must be first to define GetCurrentDirectory
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+#endif
#endif
#include "cmGlobalGenerator.h"
@@ -300,7 +303,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
cmSystemTools::SplitProgramPath(makeProgram.c_str(),
dir, file);
std::string saveFile = file;
- cmSystemTools::GetShortPath(makeProgram.c_str(), makeProgram);
+ cmSystemTools::GetShortPath(makeProgram, makeProgram);
cmSystemTools::SplitProgramPath(makeProgram.c_str(),
dir, file);
makeProgram = dir;
@@ -318,7 +321,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
// will run xcodebuild and if it sees the error text file busy
// it will stop forwarding output, and let the build finish.
// Then it will retry the build. It will continue this
- // untill no text file busy errors occur.
+ // until no text file busy errors occur.
std::string cmakexbuild =
this->CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_COMMAND");
cmakexbuild = cmakexbuild.substr(0, cmakexbuild.length()-5);
@@ -456,7 +459,14 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (push)
+# pragma warning (disable:4996)
+#endif
GetVersionEx (&osvi);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (pop)
+#endif
cmOStringStream windowsVersionString;
windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion;
windowsVersionString.str();
@@ -691,7 +701,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
compilerLangFile += "/CMake";
compilerLangFile += lang;
compilerLangFile += "Compiler.cmake";
- cmSystemTools::RemoveFile(compilerLangFile.c_str());
+ cmSystemTools::RemoveFile(compilerLangFile);
if(!this->CMakeInstance->GetIsInTryCompile())
{
this->PrintCompilerAdvice(noCompiler, lang,
@@ -758,7 +768,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
compilerLangFile += "/CMake";
compilerLangFile += lang;
compilerLangFile += "Compiler.cmake";
- cmSystemTools::RemoveFile(compilerLangFile.c_str());
+ cmSystemTools::RemoveFile(compilerLangFile);
}
} // end if in try compile
} // end need test language
@@ -1008,9 +1018,9 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l,
if (sscanf(linkerPref, "%d", &preference)!=1)
{
// backward compatibility: before 2.6 LINKER_PREFERENCE
- // was either "None" or "Prefered", and only the first character was
+ // was either "None" or "Preferred", and only the first character was
// tested. So if there is a custom language out there and it is
- // "Prefered", set its preference high
+ // "Preferred", set its preference high
if (linkerPref[0]=='P')
{
preference = 100;
@@ -1253,8 +1263,6 @@ void cmGlobalGenerator::Generate()
// Create per-target generator information.
this->CreateGeneratorTargets();
- this->ForceLinkerLanguages();
-
#ifdef CMAKE_BUILD_WITH_CMAKE
for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
++it)
@@ -1270,6 +1278,8 @@ void cmGlobalGenerator::Generate()
this->LocalGenerators[i]->TraceDependencies();
}
+ this->ForceLinkerLanguages();
+
// Compute the manifest of main targets generated.
for (i = 0; i < this->LocalGenerators.size(); ++i)
{
@@ -1735,7 +1745,7 @@ int cmGlobalGenerator::Build(
* Run an executable command and put the stdout in output.
*/
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(bindir.c_str());
+ cmSystemTools::ChangeDirectory(bindir);
output += "Change Dir: ";
output += bindir;
output += "\n";
@@ -1765,7 +1775,7 @@ int cmGlobalGenerator::Build(
output += "\nGenerator: execution of make clean failed.\n";
// return to the original directory
- cmSystemTools::ChangeDirectory(cwd.c_str());
+ cmSystemTools::ChangeDirectory(cwd);
return 1;
}
output += *outputPtr;
@@ -1792,7 +1802,7 @@ int cmGlobalGenerator::Build(
+ makeCommandStr + "\n";
// return to the original directory
- cmSystemTools::ChangeDirectory(cwd.c_str());
+ cmSystemTools::ChangeDirectory(cwd);
return 1;
}
output += *outputPtr;
@@ -1806,7 +1816,7 @@ int cmGlobalGenerator::Build(
retVal = 1;
}
- cmSystemTools::ChangeDirectory(cwd.c_str());
+ cmSystemTools::ChangeDirectory(cwd);
return retVal;
}
@@ -2724,7 +2734,7 @@ cmGlobalGenerator::GetDirectoryContent(std::string const& dir, bool needDisk)
{
// Load the directory content from disk.
cmsys::Directory d;
- if(d.Load(dir.c_str()))
+ if(d.Load(dir))
{
unsigned long n = d.GetNumberOfFiles();
for(unsigned long i = 0; i < n; ++i)
@@ -2831,8 +2841,8 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
{
// The rule has changed. Delete the output so it will be
// built again.
- fname = cmSystemTools::CollapseFullPath(fname.c_str(), home.c_str());
- cmSystemTools::RemoveFile(fname.c_str());
+ fname = cmSystemTools::CollapseFullPath(fname, home.c_str());
+ cmSystemTools::RemoveFile(fname);
}
}
else
@@ -2844,7 +2854,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
// that if the feature is turned back on and the rule has
// changed the file is still rebuilt.
std::string fpath =
- cmSystemTools::CollapseFullPath(fname.c_str(), home.c_str());
+ cmSystemTools::CollapseFullPath(fname, home.c_str());
if(cmSystemTools::FileExists(fpath.c_str()))
{
RuleHash hash;
@@ -2861,7 +2871,7 @@ void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile)
// Now generate a new persistence file with the current hashes.
if(this->RuleHashes.empty())
{
- cmSystemTools::RemoveFile(pfile.c_str());
+ cmSystemTools::RemoveFile(pfile);
}
else
{
@@ -2966,7 +2976,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
}
else
{
- cmSystemTools::RemoveFile(file.c_str());
+ cmSystemTools::RemoveFile(file);
}
}
@@ -2984,6 +2994,32 @@ std::string cmGlobalGenerator::EscapeJSON(const std::string& s) {
}
//----------------------------------------------------------------------------
+void cmGlobalGenerator::SetFilenameTargetDepends(cmSourceFile* sf,
+ std::set<cmTarget const*> tgts)
+{
+ this->FilenameTargetDepends[sf] = tgts;
+}
+
+//----------------------------------------------------------------------------
+std::set<cmTarget const*> const&
+cmGlobalGenerator::GetFilenameTargetDepends(cmSourceFile* sf) const {
+ return this->FilenameTargetDepends[sf];
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalGenerator::CreateEvaluationSourceFiles(
+ std::string const& config) const
+{
+ for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
+ li = this->EvaluationFiles.begin();
+ li != this->EvaluationFiles.end();
+ ++li)
+ {
+ (*li)->CreateOutputFile(config);
+ }
+}
+
+//----------------------------------------------------------------------------
void cmGlobalGenerator::AddEvaluationFile(const std::string &inputFile,
cmsys::auto_ptr<cmCompiledGeneratorExpression> outputExpr,
cmMakefile *makefile,