summaryrefslogtreecommitdiffstats
path: root/Source/cmExportCommand.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2017-03-23 13:32:08 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-18 15:36:10 (GMT)
commiteec93bceec5411e4409b5e3ee5dc301fca6fcbfd (patch)
tree58758ce2d61173c52559f55c0979236cafa7f969 /Source/cmExportCommand.cxx
parent93c89bc75ceee599ba7c08b8fe1ac5104942054f (diff)
downloadCMake-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/cmExportCommand.cxx')
-rw-r--r--Source/cmExportCommand.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 691048b..38cd511 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -149,11 +149,15 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
if (cmTarget* target = gg->FindTarget(*currentTarget)) {
if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
- std::ostringstream e;
- e << "given OBJECT library \"" << *currentTarget
- << "\" which may not be exported.";
- this->SetError(e.str());
- return false;
+ std::string reason;
+ if (!this->Makefile->GetGlobalGenerator()
+ ->HasKnownObjectFileLocation(&reason)) {
+ std::ostringstream e;
+ e << "given OBJECT library \"" << *currentTarget
+ << "\" which may not be exported" << reason << ".";
+ this->SetError(e.str());
+ return false;
+ }
}
if (target->GetType() == cmStateEnums::UTILITY) {
this->SetError("given custom target \"" + *currentTarget +