[Cmake-commits] CMake branch, master, updated. v3.8.0-1005-gd828d0e

Kitware Robot kwrobot at kitware.com
Fri Apr 28 10:05:02 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  d828d0eb084cf094119d2b47dae0053267aba138 (commit)
       via  47990f9fef31eb4369bb01d72a6d86de332ae196 (commit)
       via  a8667467ea6337faddb0eeb7a8d0b08154338ac0 (commit)
      from  2911d4701675d17b817f8fbe607bb5a493cacf0c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d828d0eb084cf094119d2b47dae0053267aba138
commit d828d0eb084cf094119d2b47dae0053267aba138
Merge: 2911d47 47990f9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 28 13:55:36 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 28 09:55:44 2017 -0400

    Merge topic 'refactor-ipo-flags'
    
    47990f9f Inline and remove AddFeatureFlags method
    a8667467 Add IPO compiler flags more consistently in generators
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !772


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47990f9fef31eb4369bb01d72a6d86de332ae196
commit 47990f9fef31eb4369bb01d72a6d86de332ae196
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 27 16:21:37 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 27 16:21:59 2017 -0400

    Inline and remove AddFeatureFlags method
    
    The method implementation is now only one call of another method, so
    inline it at call sites and remove it.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 8114020..391d65c 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -43,14 +43,6 @@ const char* cmCommonTargetGenerator::GetFeature(const std::string& feature)
   return this->GeneratorTarget->GetFeature(feature, this->ConfigName);
 }
 
-void cmCommonTargetGenerator::AddFeatureFlags(std::string& flags,
-                                              const std::string& lang)
-{
-  // Add language-specific flags.
-  this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget, lang,
-                                         this->ConfigName);
-}
-
 void cmCommonTargetGenerator::AddModuleDefinitionFlag(
   cmLinkLineComputer* linkLineComputer, std::string& flags)
 {
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 8ba2e22..c36145f 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -28,9 +28,6 @@ public:
   std::string const& GetConfigName() const;
 
 protected:
-  // Add language feature flags.
-  void AddFeatureFlags(std::string& flags, const std::string& lang);
-
   // Feature query methods.
   const char* GetFeature(const std::string& feature);
 
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index a719887..272d45b 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -150,7 +150,8 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
                                       linkLanguage, *this->GeneratorTarget));
 
   // Add language feature flags.
-  this->AddFeatureFlags(flags, linkLanguage);
+  this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
+                                         linkLanguage, this->ConfigName);
 
   this->LocalGenerator->AddArchitectureFlags(flags, this->GeneratorTarget,
                                              linkLanguage, this->ConfigName);
@@ -433,7 +434,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   }
 
   // Add language feature flags.
-  this->AddFeatureFlags(flags, linkLanguage);
+  this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
+                                         linkLanguage, this->ConfigName);
 
   this->LocalGenerator->AddArchitectureFlags(flags, this->GeneratorTarget,
                                              linkLanguage, this->ConfigName);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2823977..ec01208 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -395,9 +395,10 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
     vars.LinkFlags = linkFlags.c_str();
     vars.TargetCompilePDB = targetOutPathCompilePDB.c_str();
 
-    // Add language feature flags.
+    // Add language-specific flags.
     std::string langFlags;
-    this->AddFeatureFlags(langFlags, linkLanguage);
+    this->LocalGenerator->AddLanguageFlags(langFlags, this->GeneratorTarget,
+                                           linkLanguage, this->ConfigName);
 
     vars.LanguageCompileFlags = langFlags.c_str();
 
@@ -853,9 +854,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
       }
     }
 
-    // Add language feature flags.
+    // Add language-specific flags.
     std::string langFlags;
-    this->AddFeatureFlags(langFlags, linkLanguage);
+    this->LocalGenerator->AddLanguageFlags(langFlags, this->GeneratorTarget,
+                                           linkLanguage, this->ConfigName);
 
     this->LocalGenerator->AddArchitectureFlags(
       langFlags, this->GeneratorTarget, linkLanguage, this->ConfigName);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8667467ea6337faddb0eeb7a8d0b08154338ac0
commit a8667467ea6337faddb0eeb7a8d0b08154338ac0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 27 16:15:07 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 27 16:15:07 2017 -0400

    Add IPO compiler flags more consistently in generators
    
    Move addition of IPO flags into `cmLocalGenerator::AddLanguageFlags`
    because all call sites of that need the IPO flags, but not all were
    following the call with `AppendFeatureOptions`.

diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 178a7ce..8114020 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -47,11 +47,8 @@ void cmCommonTargetGenerator::AddFeatureFlags(std::string& flags,
                                               const std::string& lang)
 {
   // Add language-specific flags.
-  this->LocalGenerator->AddLanguageFlags(flags, lang, this->ConfigName);
-
-  if (this->GeneratorTarget->IsIPOEnabled(this->ConfigName)) {
-    this->LocalGenerator->AppendFeatureOptions(flags, lang, "IPO");
-  }
+  this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget, lang,
+                                         this->ConfigName);
 }
 
 void cmCommonTargetGenerator::AddModuleDefinitionFlag(
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index ba623d5..7032cd5 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -232,10 +232,12 @@ void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
     const char* lang = language.c_str();
 
     if (notKernel) {
-      this->LocalGenerator->AddLanguageFlags(flags, lang, config);
+      this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
+                                             lang, config);
     } else {
-      this->LocalGenerator->AddLanguageFlags(
-        flags, lang + std::string("_GHS_KERNEL"), config);
+      this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
+                                             lang + std::string("_GHS_KERNEL"),
+                                             config);
     }
     this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget, lang,
                                           config);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6636329..d99e3bb 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1662,7 +1662,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
     std::string& flags = cflags[lang];
 
     // Add language-specific flags.
-    this->CurrentLocalGenerator->AddLanguageFlags(flags, lang, configName);
+    this->CurrentLocalGenerator->AddLanguageFlags(flags, gtgt, lang,
+                                                  configName);
 
     // Add shared-library flags if needed.
     this->CurrentLocalGenerator->AddCMP0018Flags(flags, gtgt, lang,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 424ab6f..57b744c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -985,7 +985,7 @@ void cmLocalGenerator::GetTargetFlags(
           target->GetName().c_str());
         return;
       }
-      this->AddLanguageFlags(flags, linkLanguage, buildType);
+      this->AddLanguageFlags(flags, target, linkLanguage, buildType);
       if (pcli) {
         this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs,
                                   frameworkPath, linkPath);
@@ -1050,11 +1050,7 @@ void cmLocalGenerator::GetTargetCompileFlags(cmGeneratorTarget* target,
   cmMakefile* mf = this->GetMakefile();
 
   // Add language-specific flags.
-  this->AddLanguageFlags(flags, lang, config);
-
-  if (target->IsIPOEnabled(config)) {
-    this->AppendFeatureOptions(flags, lang, "IPO");
-  }
+  this->AddLanguageFlags(flags, target, lang, config);
 
   this->AddArchitectureFlags(flags, target, lang, config);
 
@@ -1287,6 +1283,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
 }
 
 void cmLocalGenerator::AddLanguageFlags(std::string& flags,
+                                        cmGeneratorTarget const* target,
                                         const std::string& lang,
                                         const std::string& config)
 {
@@ -1295,6 +1292,10 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
   flagsVar += lang;
   flagsVar += "_FLAGS";
   this->AddConfigVariableFlags(flags, flagsVar, config);
+
+  if (target->IsIPOEnabled(config)) {
+    this->AppendFeatureOptions(flags, lang, "IPO");
+  }
 }
 
 cmGeneratorTarget* cmLocalGenerator::FindGeneratorTargetToUse(
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 1459a05..2eda0e5 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -98,8 +98,8 @@ public:
                             const std::string& lang,
                             const std::string& config);
 
-  void AddLanguageFlags(std::string& flags, const std::string& lang,
-                        const std::string& config);
+  void AddLanguageFlags(std::string& flags, cmGeneratorTarget const* target,
+                        const std::string& lang, const std::string& config);
   void AddCMP0018Flags(std::string& flags, cmGeneratorTarget const* target,
                        std::string const& lang, const std::string& config);
   void AddVisibilityPresetFlags(std::string& flags,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 8206083..54ae196 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -655,7 +655,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
     localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName);
     vars["ARCH_FLAGS"] = t;
     t = "";
-    localGen.AddLanguageFlags(t, cudaLinkLanguage, cfgName);
+    localGen.AddLanguageFlags(t, &genTarget, cudaLinkLanguage, cfgName);
     vars["LANGUAGE_COMPILE_FLAGS"] = t;
   }
   if (this->GetGeneratorTarget()->HasSOName(cfgName)) {
@@ -874,7 +874,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     vars["ARCH_FLAGS"] = t;
     t = "";
     t += lwyuFlags;
-    localGen.AddLanguageFlags(t, TargetLinkLanguage, cfgName);
+    localGen.AddLanguageFlags(t, &genTarget, TargetLinkLanguage, cfgName);
     vars["LANGUAGE_COMPILE_FLAGS"] = t;
   }
   if (this->GetGeneratorTarget()->HasSOName(cfgName)) {

-----------------------------------------------------------------------

Summary of changes:
 Source/cmCommonTargetGenerator.cxx             |   11 -----------
 Source/cmCommonTargetGenerator.h               |    3 ---
 Source/cmGhsMultiTargetGenerator.cxx           |    8 +++++---
 Source/cmGlobalXCodeGenerator.cxx              |    3 ++-
 Source/cmLocalGenerator.cxx                    |   13 +++++++------
 Source/cmLocalGenerator.h                      |    4 ++--
 Source/cmMakefileExecutableTargetGenerator.cxx |    6 ++++--
 Source/cmMakefileLibraryTargetGenerator.cxx    |   10 ++++++----
 Source/cmNinjaNormalTargetGenerator.cxx        |    4 ++--
 9 files changed, 28 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list