diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2017-03-23 13:32:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-18 15:36:10 (GMT) |
commit | eec93bceec5411e4409b5e3ee5dc301fca6fcbfd (patch) | |
tree | 58758ce2d61173c52559f55c0979236cafa7f969 /Source/cmGeneratorExpressionNode.cxx | |
parent | 93c89bc75ceee599ba7c08b8fe1ac5104942054f (diff) | |
download | CMake-eec93bceec5411e4409b5e3ee5dc301fca6fcbfd.zip CMake-eec93bceec5411e4409b5e3ee5dc301fca6fcbfd.tar.gz CMake-eec93bceec5411e4409b5e3ee5dc301fca6fcbfd.tar.bz2 |
Allow OBJECT libraries to be installed, exported, and imported
Teach install() and export() to handle the actual object files.
Disallow this on Xcode with multiple architectures because it
still cannot be cleanly supported there.
Co-Author: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 1215737..77a4962 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1257,24 +1257,35 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode } std::vector<std::string> objects; - gt->GetTargetObjectNames(context->Config, objects); - - std::string obj_dir; - if (context->EvaluateForBuildsystem) { - // Use object file directory with buildsystem placeholder. - obj_dir = gt->ObjectDirectory; - // Here we assume that the set of object files produced - // by an object library does not vary with configuration - // and do not set HadContextSensitiveCondition to true. - } else { - // Use object file directory with per-config location. - obj_dir = gt->GetObjectDirectory(context->Config); + + if (gt->IsImported()) { + const char* loc = CM_NULLPTR; + const char* imp = CM_NULLPTR; + std::string suffix; + if (gt->Target->GetMappedConfig(context->Config, &loc, &imp, suffix)) { + cmSystemTools::ExpandListArgument(loc, objects); + } context->HadContextSensitiveCondition = true; - } + } else { + gt->GetTargetObjectNames(context->Config, objects); + + std::string obj_dir; + if (context->EvaluateForBuildsystem) { + // Use object file directory with buildsystem placeholder. + obj_dir = gt->ObjectDirectory; + // Here we assume that the set of object files produced + // by an object library does not vary with configuration + // and do not set HadContextSensitiveCondition to true. + } else { + // Use object file directory with per-config location. + obj_dir = gt->GetObjectDirectory(context->Config); + context->HadContextSensitiveCondition = true; + } - for (std::vector<std::string>::iterator oi = objects.begin(); - oi != objects.end(); ++oi) { - *oi = obj_dir + *oi; + for (std::vector<std::string>::iterator oi = objects.begin(); + oi != objects.end(); ++oi) { + *oi = obj_dir + *oi; + } } // Create the cmSourceFile instances in the referencing directory. |