summaryrefslogtreecommitdiff
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-03-22 09:45:25 -0400
committerBrad King <brad.king@kitware.com>2007-03-22 09:45:25 -0400
commit5a32aa5919bd9dab272748c0e0ea12fbcd36436b (patch)
treeb4b0d2c70b896a8c95c91c88112ec2b3bb9d987d /Source/cmMakefileExecutableTargetGenerator.cxx
parent187816c9371e49769c02481ea46491b2d7e22d66 (diff)
downloadcmake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.tar.gz
ENH: Added target property ENABLE_EXPORTS for executable targets. It enables the executables for linking by loadable modules that import symbols from the executable. This finishes the executable import library support mentioned in bug #4210.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 2414458005..48aa2849dc 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -347,6 +347,19 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string linkRule =
this->Makefile->GetRequiredDefinition(linkRuleVar.c_str());
cmSystemTools::ExpandListArgument(linkRule, commands1);
+ if(this->Target->GetPropertyAsBool("ENABLE_EXPORTS"))
+ {
+ // If a separate rule for creating an import library is specified
+ // add it now.
+ std::string implibRuleVar = "CMAKE_";
+ implibRuleVar += linkLanguage;
+ implibRuleVar += "_CREATE_IMPORT_LIBRARY";
+ if(const char* rule =
+ this->Makefile->GetDefinition(implibRuleVar.c_str()))
+ {
+ cmSystemTools::ExpandListArgument(rule, commands1);
+ }
+ }
this->LocalGenerator->CreateCDCommand
(commands1,
this->Makefile->GetStartOutputDirectory(),