summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-19 22:42:01 +0200
committerStephen Kelly <steveire@gmail.com>2015-10-21 00:52:22 +0200
commit311018e5ad27abf7c76003ec91d3f26ef316e3cc (patch)
tree12691ae0c22b86e09aa0a1bef1e6ca5fa8b1bb9c /Source/cmGeneratorTarget.cxx
parent215cd21a0238ba00aec7c81014fe83e3d47187a6 (diff)
downloadcmake-311018e5ad27abf7c76003ec91d3f26ef316e3cc.tar.gz
cmGeneratorTarget: Move GetExportMacro from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0a1a364fa7..f41243ec6a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1709,6 +1709,32 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
}
//----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetExportMacro() const
+{
+ // Define the symbol for targets that export symbols.
+ if(this->GetType() == cmState::SHARED_LIBRARY ||
+ this->GetType() == cmState::MODULE_LIBRARY ||
+ this->IsExecutableWithExports())
+ {
+ if(const char* custom_export_name = this->GetProperty("DEFINE_SYMBOL"))
+ {
+ this->ExportMacro = custom_export_name;
+ }
+ else
+ {
+ std::string in = this->GetName();
+ in += "_EXPORTS";
+ this->ExportMacro = cmSystemTools::MakeCidentifier(in);
+ }
+ return this->ExportMacro.c_str();
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+//----------------------------------------------------------------------------
class cmTargetCollectLinkLanguages
{
public: