summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.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/cmLocalVisualStudio7Generator.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/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx18
1 files changed, 3 insertions, 15 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 71a1e0d..97bd3b4 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -520,22 +520,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
configDefine += "\\\"";
targetOptions.AddDefine(configDefine);
- // Add a definition for the export macro.
- if(target.GetType() == cmTarget::SHARED_LIBRARY ||
- target.GetType() == cmTarget::MODULE_LIBRARY)
+ // Add the export symbol definition for shared library objects.
+ if(const char* exportMacro = target.GetExportMacro())
{
- std::string exportSymbol;
- if(const char* custom_export_name = target.GetProperty("DEFINE_SYMBOL"))
- {
- exportSymbol = custom_export_name;
- }
- else
- {
- std::string id = libName;
- id += "_EXPORTS";
- exportSymbol = cmSystemTools::MakeCindentifier(id.c_str());
- }
- targetOptions.AddDefine(exportSymbol);
+ targetOptions.AddDefine(exportMacro);
}
// The intermediate directory name consists of a directory for the