diff options
author | Brad King <brad.king@kitware.com> | 2007-03-22 13:45:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-03-22 13:45:25 (GMT) |
commit | 5a32aa5919bd9dab272748c0e0ea12fbcd36436b (patch) | |
tree | b4b0d2c70b896a8c95c91c88112ec2b3bb9d987d /Source/cmLocalGenerator.cxx | |
parent | 187816c9371e49769c02481ea46491b2d7e22d66 (diff) | |
download | CMake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.zip CMake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.tar.gz CMake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.tar.bz2 |
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/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 71d3c51..c7f50f6 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1659,9 +1659,19 @@ void cmLocalGenerator { // Compute the proper name to use to link this library. cmTarget* tgt = this->GlobalGenerator->FindTarget(0, lib.c_str()); - if(tgt && (tgt->GetType() == cmTarget::STATIC_LIBRARY || - tgt->GetType() == cmTarget::SHARED_LIBRARY || - tgt->GetType() == cmTarget::MODULE_LIBRARY)) + bool impexe = (tgt && + tgt->GetType() == cmTarget::EXECUTABLE && + tgt->GetPropertyAsBool("ENABLE_EXPORTS")); + if(impexe && !implib) + { + // Skip linking to executables on platforms with no import + // libraries. + continue; + } + else if(tgt && (tgt->GetType() == cmTarget::STATIC_LIBRARY || + tgt->GetType() == cmTarget::SHARED_LIBRARY || + tgt->GetType() == cmTarget::MODULE_LIBRARY || + impexe)) { // This is a CMake target. Ask the target for its real name. // Pass the full path to the target file but purposely leave |