summaryrefslogtreecommitdiff
path: root/cpp/src/slice2objc/Gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2objc/Gen.cpp')
-rw-r--r--cpp/src/slice2objc/Gen.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp
index 9d51de398e4..794570bc4d0 100644
--- a/cpp/src/slice2objc/Gen.cpp
+++ b/cpp/src/slice2objc/Gen.cpp
@@ -690,6 +690,21 @@ Slice::Gen::generate(const UnitPtr& p)
{
ObjCGenerator::validateMetaData(p);
+ //
+ // Give precedence to --dll-export command-line option
+ //
+ if(_dllExport.empty())
+ {
+ DefinitionContextPtr dc = p->findDefinitionContext(p->topLevelFile());
+ assert(dc);
+ static const string dllExportPrefix = "objc:dll-export:";
+ string meta = dc->findMetaData(dllExportPrefix);
+ if(meta.size() > dllExportPrefix.size())
+ {
+ _dllExport = meta.substr(dllExportPrefix.size());
+ }
+ }
+
_H << sp << nl << "#import <objc/Ice/Config.h>";
if(p->hasNonLocalClassDecls())
{