diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/CPack/cmCPackPackageMakerGenerator.cxx | 34 | ||||
-rw-r--r-- | Source/CPack/cmCPackPackageMakerGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 5 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGetTargetPropertyCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 11 | ||||
-rw-r--r-- | Source/cmMakefile.h | 6 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 17 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmSourceFile.cxx | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 | ||||
-rw-r--r-- | Source/kwsys/Terminal.c | 1 |
13 files changed, 80 insertions, 26 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 1461bb1..84e6482 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -628,6 +628,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cmGlobalGenerator* globalGenerator = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( cmakeGenerator); + if ( !globalGenerator ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Specified package generator not found. " + "CPACK_CMAKE_GENERATOR value is invalid." + << std::endl); + return 0; + } // set the global flag for unix style paths on cmSystemTools as // soon as the generator is set. This allows gmake to be used // on windows. diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index d736948..e58415c 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -24,11 +24,20 @@ #include <cmsys/Glob.hxx> #include <cmsys/FStream.hxx> +#include <assert.h> + +static inline +unsigned int getVersion(unsigned int major, unsigned int minor) +{ + assert(major < 256 && minor < 256); + return ((major & 0xFF) << 16 | minor); +} + //---------------------------------------------------------------------- cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator() { this->PackageMakerVersion = 0.0; - this->PackageCompatibilityVersion = 10.4; + this->PackageCompatibilityVersion = getVersion(10, 4); } //---------------------------------------------------------------------- @@ -39,7 +48,7 @@ cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator() //---------------------------------------------------------------------- bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const { - return this->PackageCompatibilityVersion >= 10.4; + return this->PackageCompatibilityVersion >= getVersion(10, 4); } //---------------------------------------------------------------------- @@ -241,7 +250,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string packageFile; if (compIt->second.IsDownloaded) { - if (this->PackageCompatibilityVersion >= 10.5 && + if (this->PackageCompatibilityVersion >= getVersion(10, 5) && this->PackageMakerVersion >= 3.0) { // Build this package within the upload directory. @@ -260,7 +269,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() } else if (!warnedAboutDownloadCompatibility) { - if (this->PackageCompatibilityVersion < 10.5) + if (this->PackageCompatibilityVersion < getVersion(10, 5)) { cmCPackLogger( cmCPackLog::LOG_WARNING, @@ -520,22 +529,29 @@ int cmCPackPackageMakerGenerator::InitializeInternal() const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION"); if (packageCompat && *packageCompat) { - this->PackageCompatibilityVersion = atof(packageCompat); + unsigned int majorVersion = 10; + unsigned int minorVersion = 5; + int res = sscanf(packageCompat, "%u.%u", &majorVersion, &minorVersion); + if (res == 2) + { + this->PackageCompatibilityVersion = + getVersion(majorVersion, minorVersion); + } } else if (this->GetOption("CPACK_DOWNLOAD_SITE")) { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.5"); - this->PackageCompatibilityVersion = 10.5; + this->PackageCompatibilityVersion = getVersion(10, 5); } else if (this->GetOption("CPACK_COMPONENTS_ALL")) { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.4"); - this->PackageCompatibilityVersion = 10.4; + this->PackageCompatibilityVersion = getVersion(10, 4); } else { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.3"); - this->PackageCompatibilityVersion = 10.3; + this->PackageCompatibilityVersion = getVersion(10, 3); } std::vector<std::string> no_paths; @@ -712,7 +728,7 @@ GenerateComponentPackage(const char *packageFile, // The command that will be used to run PackageMaker cmOStringStream pkgCmd; - if (this->PackageCompatibilityVersion < 10.5 || + if (this->PackageCompatibilityVersion < getVersion(10, 5) || this->PackageMakerVersion < 3.0) { // Create Description.plist and Info.plist files for normal Mac OS diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index e350a60..4f9e2a8 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -117,7 +117,7 @@ protected: cmCPackComponent PostFlightComponent; double PackageMakerVersion; - double PackageCompatibilityVersion; + unsigned int PackageCompatibilityVersion; }; #endif diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 1fb8f30..a636d23 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -266,9 +266,10 @@ cmComputeLinkDepends::Compute() // Iterate in reverse order so we can keep only the last occurrence // of a shared library. std::set<int> emmitted; + const std::vector<int>& cFLO = this->FinalLinkOrder; for(std::vector<int>::const_reverse_iterator - li = this->FinalLinkOrder.rbegin(), - le = this->FinalLinkOrder.rend(); + li = cFLO.rbegin(), + le = cFLO.rend(); li != le; ++li) { int i = *li; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 84a4daa..d5d78d5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1373,10 +1373,17 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode for (LangMap::const_iterator lit = testedFeatures.begin(); lit != testedFeatures.end(); ++lit) { + std::vector<std::string> const& langAvailable + = availableFeatures[lit->first]; for (std::vector<std::string>::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { - if (!context->Makefile->HaveFeatureAvailable(target, + if (std::find(langAvailable.begin(), langAvailable.end(), *it) + == langAvailable.end()) + { + return "0"; + } + if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { if (evalLL) diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..fb59df8 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -23,6 +23,7 @@ bool cmGetTargetPropertyCommand std::string var = args[0]; const std::string& targetName = args[1]; std::string prop; + bool prop_exists = false; if(args[2] == "ALIASED_TARGET") { @@ -32,6 +33,7 @@ bool cmGetTargetPropertyCommand this->Makefile->FindTargetToUse(targetName)) { prop = target->GetName(); + prop_exists = true; } } } @@ -42,6 +44,7 @@ bool cmGetTargetPropertyCommand if(prop_cstr) { prop = prop_cstr; + prop_exists = true; } } else @@ -74,7 +77,7 @@ bool cmGetTargetPropertyCommand } } } - if (!prop.empty()) + if (prop_exists) { this->Makefile->AddDefinition(var, prop.c_str()); return true; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b7e89b8..ab77e4a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5130,18 +5130,19 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const } //---------------------------------------------------------------------------- -bool cmMakefile::HaveFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const { return lang == "C" - ? this->HaveCFeatureAvailable(target, feature) - : this->HaveCxxFeatureAvailable(target, feature); + ? this->HaveCStandardAvailable(target, feature) + : this->HaveCxxStandardAvailable(target, feature); } //---------------------------------------------------------------------------- bool cmMakefile:: -HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const +HaveCStandardAvailable(cmTarget const* target, + const std::string& feature) const { bool needC90 = false; bool needC99 = false; @@ -5218,7 +5219,7 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, } //---------------------------------------------------------------------------- -bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { bool needCxx98 = false; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 28f8686..24a4f00 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -935,7 +935,7 @@ public: const char* CompileFeaturesAvailable(const std::string& lang, std::string *error) const; - bool HaveFeatureAvailable(cmTarget const* target, std::string const& lang, + bool HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const; bool IsLaterStandard(std::string const& lang, @@ -1158,9 +1158,9 @@ private: void CheckNeededCxxLanguage(const std::string& feature, bool& needCxx98, bool& needCxx11, bool& needCxx14) const; - bool HaveCFeatureAvailable(cmTarget const* target, + bool HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const; - bool HaveCxxFeatureAvailable(cmTarget const* target, + bool HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const; mutable bool SuppressWatches; diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index e344df4..a05719d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -110,13 +110,26 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules() << "\n\n"; #endif + // Write rules for languages compiled in this target. std::set<std::string> languages; - this->GetTarget()->GetLanguages(languages, - this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE")); + std::vector<cmSourceFile*> sourceFiles; + this->GetTarget()->GetSourceFiles(sourceFiles, + this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE")); + for(std::vector<cmSourceFile*>::const_iterator + i = sourceFiles.begin(); i != sourceFiles.end(); ++i) + { + const std::string& lang = (*i)->GetLanguage(); + if(!lang.empty()) + { + languages.insert(lang); + } + } for(std::set<std::string>::const_iterator l = languages.begin(); l != languages.end(); ++l) + { this->WriteLanguageRules(*l); + } } const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 816e6d8..b8cc5fb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -454,7 +454,10 @@ cmNinjaTargetGenerator std::vector<std::string> compileCmds; cmSystemTools::ExpandListArgument(compileCmd, compileCmds); - compileCmds.front().insert(0, cldeps); + if (!compileCmds.empty()) + { + compileCmds.front().insert(0, cldeps); + } for (std::vector<std::string>::iterator i = compileCmds.begin(); i != compileCmds.end(); ++i) diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index b833d3f..12eb411 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -24,7 +24,7 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name): this->CustomCommand = 0; this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); this->FindFullPathFailed = false; - this->IsUiFile = ("ui" == + this->IsUiFile = (".ui" == cmSystemTools::GetFilenameLastExtension(this->Location.GetName())); } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ad1c83e..4ebc1ce 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -547,6 +547,7 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceMap.clear(); this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear(); this->Internal->LinkClosureMap.clear(); + this->Internal->SourceFilesMap.clear(); for (cmTargetLinkInformationMap::const_iterator it = this->LinkInformation.begin(); it != this->LinkInformation.end(); ++it) diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index e13003f..d13f79a 100644 --- a/Source/kwsys/Terminal.c +++ b/Source/kwsys/Terminal.c @@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] = "xterm-88color", "xterm-color", "xterm-debian", + "xterm-termite", 0 }; |