summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-03-28 03:13:25 (GMT)
committerBrad King <brad.king@kitware.com>2007-03-28 03:13:25 (GMT)
commitaf95f61d76f2a9e86aed35adae5302c8c60fdb35 (patch)
tree7ca8e89bb2b0f6d634f4858890041e9480fa67e8 /Source/cmMakefileTargetGenerator.cxx
parent341853c887bcf54a5476bec71216ef34dd5b9295 (diff)
downloadCMake-af95f61d76f2a9e86aed35adae5302c8c60fdb35.zip
CMake-af95f61d76f2a9e86aed35adae5302c8c60fdb35.tar.gz
CMake-af95f61d76f2a9e86aed35adae5302c8c60fdb35.tar.bz2
ENH: Created method cmTarget::GetExportMacro to centralize computation of the export symbol name. This removes duplicate code from all the generators. Also enabled the export definition for executable targets with the ENABLE_EXPORTS property set.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1f6fe63..0a1b9c8 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -243,23 +243,14 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
{
const char *lang = l->first.c_str();
std::string flags;
- // Add the export symbol definition for shared library objects.
bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) ||
(this->Target->GetType() == cmTarget::MODULE_LIBRARY));
- if(shared)
+
+ // Add the export symbol definition for shared library objects.
+ if(const char* exportMacro = this->Target->GetExportMacro())
{
flags += "-D";
- if(const char* custom_export_name =
- this->Target->GetProperty("DEFINE_SYMBOL"))
- {
- flags += custom_export_name;
- }
- else
- {
- std::string in = this->Target->GetName();
- in += "_EXPORTS";
- flags += cmSystemTools::MakeCindentifier(in.c_str());
- }
+ flags += exportMacro;
}
// Add language-specific flags.