[Cmake-commits] CMake branch, next, updated. v3.8.0-rc1-33-g6a98f43
Brad King
brad.king at kitware.com
Tue Feb 7 14:40:39 EST 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, next has been updated
via 6a98f43c2894bbf324ae31311e5e0ef021a2c3b3 (commit)
via b99d0e064557f6d59da35da34a7d5ae39cd44644 (commit)
from b44b3df4e1f9ee55734c2e02f37459e2bea5dc1d (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=6a98f43c2894bbf324ae31311e5e0ef021a2c3b3
commit 6a98f43c2894bbf324ae31311e5e0ef021a2c3b3
Merge: b44b3df b99d0e0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 7 14:40:38 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 7 14:40:38 2017 -0500
Merge topic 'lang-flag-order' into next
b99d0e06 Move language standard options to the beginning of compiler flags
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b99d0e064557f6d59da35da34a7d5ae39cd44644
commit b99d0e064557f6d59da35da34a7d5ae39cd44644
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Feb 6 13:10:54 2017 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 6 13:10:54 2017 -0500
Move language standard options to the beginning of compiler flags
Through `CXX_STANDARD` and `COMPILE_FEATURES` target properties CMake
determines what `-std=` flag to pass to the compiler. Move this flag to
the beginning of the command line so that flags provided by users can
override it (e.g. to use a standard flag newer than CMake knows).
Fixes: #16608
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index ba623d5..5ed5817 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -231,6 +231,9 @@ void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
std::string flags;
const char* lang = language.c_str();
+ this->LocalGenerator->AddLanguageStandardOptions(
+ flags, this->GeneratorTarget, lang, config);
+
if (notKernel) {
this->LocalGenerator->AddLanguageFlags(flags, lang, config);
} else {
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 8627cf2..de716e6 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1643,6 +1643,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
li != languages.end(); ++li) {
std::string const& lang = *li;
std::string& flags = cflags[lang];
+ this->CurrentLocalGenerator->AddLanguageStandardOptions(flags, gtgt, lang,
+ configName);
// Add language-specific flags.
this->CurrentLocalGenerator->AddLanguageFlags(flags, lang, configName);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 44c390c..6e4eeeb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -746,6 +746,13 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
this->AppendFlagEscape(flags, *i);
}
}
+}
+
+void cmLocalGenerator::AddLanguageStandardOptions(std::string& flags,
+ cmGeneratorTarget* target,
+ const std::string& lang,
+ const std::string& config)
+{
std::vector<std::string> features;
target->GetCompileFeatures(features, config);
for (std::vector<std::string>::const_iterator it = features.begin();
@@ -1053,6 +1060,8 @@ void cmLocalGenerator::GetTargetCompileFlags(cmGeneratorTarget* target,
{
cmMakefile* mf = this->GetMakefile();
+ this->AddLanguageStandardOptions(flags, target, lang, config);
+
// Add language-specific flags.
this->AddLanguageFlags(flags, lang, config);
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 901ca35..689ec70 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -98,6 +98,10 @@ public:
const std::string& lang,
const std::string& config);
+ void AddLanguageStandardOptions(std::string& flags,
+ cmGeneratorTarget* target,
+ const std::string& lang,
+ const std::string& config);
void AddLanguageFlags(std::string& flags, const std::string& lang,
const std::string& config);
void AddCMP0018Flags(std::string& flags, cmGeneratorTarget const* target,
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 38dda04..04ec110 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -648,6 +648,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
target->GetName().c_str());
return;
}
+ this->AddLanguageStandardOptions(flags, target, linkLanguage, configName);
if (linkLanguage == "C" || linkLanguage == "CXX" ||
linkLanguage == "Fortran") {
std::string baseFlagVar = "CMAKE_";
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2e6c19b..1317c57 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2158,6 +2158,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
this->Name.c_str());
return false;
}
+ this->LocalGenerator->AddLanguageStandardOptions(
+ flags, this->GeneratorTarget, linkLanguage, configName);
if (linkLanguage == "C" || linkLanguage == "CXX" ||
linkLanguage == "Fortran" || linkLanguage == "CSharp") {
std::string baseFlagVar = "CMAKE_";
-----------------------------------------------------------------------
Summary of changes:
Source/cmGhsMultiTargetGenerator.cxx | 3 +++
Source/cmGlobalXCodeGenerator.cxx | 2 ++
Source/cmLocalGenerator.cxx | 9 +++++++++
Source/cmLocalGenerator.h | 4 ++++
Source/cmLocalVisualStudio7Generator.cxx | 1 +
Source/cmVisualStudio10TargetGenerator.cxx | 2 ++
6 files changed, 21 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list