summaryrefslogtreecommitdiffstats
path: root/Source/cmExportCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-21 18:37:20 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-21 18:39:10 (GMT)
commit7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a (patch)
tree7fcc67115087af898b835f71e05700789640fa4a /Source/cmExportCommand.cxx
parent3b09398ae27f0e4b5975920ac2787427ffc6ccc4 (diff)
downloadCMake-7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a.zip
CMake-7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a.tar.gz
CMake-7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a.tar.bz2
export: Reject custom target exports earlier (#15657)
Diagnose and reject custom targets given to the export() command immediately. Previously we would generate an internal error later.
Diffstat (limited to 'Source/cmExportCommand.cxx')
-rw-r--r--Source/cmExportCommand.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 43d26f9..96ea77b 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -177,6 +177,12 @@ bool cmExportCommand
this->SetError(e.str());
return false;
}
+ if (target->GetType() == cmTarget::UTILITY)
+ {
+ this->SetError("given custom target \"" + *currentTarget
+ + "\" which may not be exported.");
+ return false;
+ }
}
else
{