diff options
author | Brad King <brad.king@kitware.com> | 2007-03-28 03:13:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-03-28 03:13:25 (GMT) |
commit | af95f61d76f2a9e86aed35adae5302c8c60fdb35 (patch) | |
tree | 7ca8e89bb2b0f6d634f4858890041e9480fa67e8 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 341853c887bcf54a5476bec71216ef34dd5b9295 (diff) | |
download | CMake-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/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 53c39dd..630fda3 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1067,21 +1067,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { std::string flags; std::string defFlags; - bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) || - (target.GetType() == cmTarget::MODULE_LIBRARY)); - if(shared) + // Add the export symbol definition for shared library objects. + if(const char* exportMacro = target.GetExportMacro()) { defFlags += "-D"; - if(const char* custom_export_name = target.GetProperty("DEFINE_SYMBOL")) - { - defFlags += custom_export_name; - } - else - { - std::string in = target.GetName(); - in += "_EXPORTS"; - defFlags += cmSystemTools::MakeCindentifier(in.c_str()); - } + defFlags += exportMacro; } const char* lang = target.GetLinkerLanguage(this); std::string cflags; |