summaryrefslogtreecommitdiffstats
path: root/Source/cmExportCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportCommand.cxx')
-rw-r--r--Source/cmExportCommand.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 8102276..38cd511 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportCommand.h"
-#include <cmsys/RegularExpression.hxx>
+#include "cmsys/RegularExpression.hxx"
#include <map>
#include <sstream>
@@ -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 +
@@ -279,7 +283,6 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
-#undef GetCurrentDirectory
void cmExportCommand::ReportRegistryError(std::string const& msg,
std::string const& key, long err)
{