[Cmake-commits] CMake branch, next, updated. v3.6.0-rc1-200-g88ae1de
Brad King
brad.king at kitware.com
Fri Jun 10 09:26:53 EDT 2016
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 88ae1dea8b44cbd456e07ad372d8f0ee14b5d8a3 (commit)
via f62ed322dc0d859f595be5ddeff40904ee478f50 (commit)
via 853b1bb4ba176e886e3682a2475f1de1932ee890 (commit)
from efe13e2f0b16754a1a87b04e75421d29bd223573 (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=88ae1dea8b44cbd456e07ad372d8f0ee14b5d8a3
commit 88ae1dea8b44cbd456e07ad372d8f0ee14b5d8a3
Merge: efe13e2 f62ed32
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 10 09:26:52 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 10 09:26:52 2016 -0400
Merge topic 'refactor-cmLocalGenerator-flags' into next
f62ed322 cmLocalGenerator: Add GetTargetDefines to get all defines for a target
853b1bb4 cmLocalGenerator: Constify AppendDefines and AddCompileDefinitions
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f62ed322dc0d859f595be5ddeff40904ee478f50
commit f62ed322dc0d859f595be5ddeff40904ee478f50
Author: Tobias Hunger <tobias.hunger at qt.io>
AuthorDate: Wed Jun 8 13:23:25 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 10 09:24:49 2016 -0400
cmLocalGenerator: Add GetTargetDefines to get all defines for a target
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 131b490..b893dd3 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -246,19 +246,11 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string& l)
ByLanguageMap::iterator i = this->DefinesByLanguage.find(l);
if (i == this->DefinesByLanguage.end()) {
std::set<std::string> defines;
- const char* lang = l.c_str();
- // Add the export symbol definition for shared library objects.
- if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
- this->LocalGenerator->AppendDefines(defines, exportMacro);
- }
-
- // Add preprocessor definitions for this target and configuration.
- this->LocalGenerator->AddCompileDefinitions(
- defines, this->GeneratorTarget, this->LocalGenerator->GetConfigName(),
- l);
+ this->LocalGenerator->GetTargetDefines(this->GeneratorTarget,
+ this->ConfigName, l, defines);
std::string definesString;
- this->LocalGenerator->JoinDefines(defines, definesString, lang);
+ this->LocalGenerator->JoinDefines(defines, definesString, l);
ByLanguageMap::value_type entry(l, definesString);
i = this->DefinesByLanguage.insert(entry).first;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3f957f0..2ccaa82 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1329,6 +1329,20 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l,
return ::GetFrameworkFlags(l, config, target);
}
+void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target,
+ std::string const& config,
+ std::string const& lang,
+ std::set<std::string>& defines) const
+{
+ // Add the export symbol definition for shared library objects.
+ if (const char* exportMacro = target->GetExportMacro()) {
+ this->AppendDefines(defines, exportMacro);
+ }
+
+ // Add preprocessor definitions for this target and configuration.
+ this->AddCompileDefinitions(defines, target, config, lang.c_str());
+}
+
std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
OutputFormat format)
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index ad77c1f..55b8794 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -314,6 +314,9 @@ public:
std::string& flags, std::string& linkFlags,
std::string& frameworkPath, std::string& linkPath,
cmGeneratorTarget* target, bool useWatcomQuote);
+ void GetTargetDefines(cmGeneratorTarget const* target,
+ std::string const& config, std::string const& lang,
+ std::set<std::string>& defines) const;
std::string GetFrameworkFlags(std::string const& l,
std::string const& config,
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=853b1bb4ba176e886e3682a2475f1de1932ee890
commit 853b1bb4ba176e886e3682a2475f1de1932ee890
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 10 09:23:14 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 10 09:24:11 2016 -0400
cmLocalGenerator: Constify AppendDefines and AddCompileDefinitions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f543ec4..3f957f0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -943,7 +943,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
cmGeneratorTarget const* target,
const std::string& config,
- const std::string& lang)
+ const std::string& lang) const
{
std::vector<std::string> targetDefines;
target->GetCompileDefinitions(targetDefines, config, lang);
@@ -2051,7 +2051,7 @@ void cmLocalGenerator::AppendFlagEscape(std::string& flags,
}
void cmLocalGenerator::AppendDefines(std::set<std::string>& defines,
- const char* defines_list)
+ const char* defines_list) const
{
// Short-circuit if there are no definitions.
if (!defines_list) {
@@ -2065,7 +2065,8 @@ void cmLocalGenerator::AppendDefines(std::set<std::string>& defines,
}
void cmLocalGenerator::AppendDefines(
- std::set<std::string>& defines, const std::vector<std::string>& defines_vec)
+ std::set<std::string>& defines,
+ const std::vector<std::string>& defines_vec) const
{
for (std::vector<std::string>::const_iterator di = defines_vec.begin();
di != defines_vec.end(); ++di) {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index ac2ebce..ad77c1f 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -138,13 +138,15 @@ public:
* Encode a list of preprocessor definitions for the compiler
* command line.
*/
- void AppendDefines(std::set<std::string>& defines, const char* defines_list);
- void AppendDefines(std::set<std::string>& defines, std::string defines_list)
+ void AppendDefines(std::set<std::string>& defines,
+ const char* defines_list) const;
+ void AppendDefines(std::set<std::string>& defines,
+ std::string defines_list) const
{
this->AppendDefines(defines, defines_list.c_str());
}
void AppendDefines(std::set<std::string>& defines,
- const std::vector<std::string>& defines_vec);
+ const std::vector<std::string>& defines_vec) const;
/**
* Join a set of defines into a definesString with a space separator.
@@ -200,7 +202,7 @@ public:
void AddCompileDefinitions(std::set<std::string>& defines,
cmGeneratorTarget const* target,
const std::string& config,
- const std::string& lang);
+ const std::string& lang) const;
std::string GetProjectName() const;
-----------------------------------------------------------------------
Summary of changes:
Source/cmCommonTargetGenerator.cxx | 14 +++-----------
Source/cmLocalGenerator.cxx | 21 ++++++++++++++++++---
Source/cmLocalGenerator.h | 13 +++++++++----
3 files changed, 30 insertions(+), 18 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list