diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2013-07-22 21:25:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-25 12:44:57 (GMT) |
commit | 5837f19690c7ef490e70baedce0a8b89594da3af (patch) | |
tree | 326f0b13d8d6d47f94407c32e2a562c9512f8adb /Source/cmExportFileGenerator.cxx | |
parent | 2f8dace125a0d0f7e731e439eaa4a2a27b687248 (diff) | |
download | CMake-5837f19690c7ef490e70baedce0a8b89594da3af.zip CMake-5837f19690c7ef490e70baedce0a8b89594da3af.tar.gz CMake-5837f19690c7ef490e70baedce0a8b89594da3af.tar.bz2 |
export: Error when exporting a target without a language
First, it prevents a NULL dereference and second it reiterates that
targets without languages are not supported by CMake.
Add a RunCMake.ExportWithoutLanguage test exporting a library without a
languages.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 90e6d51..4de1aae 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -349,6 +349,16 @@ void getCompatibleInterfaceProperties(cmTarget *target, { cmComputeLinkInformation *info = target->GetLinkInformation(config); + if (!info) + { + cmMakefile* mf = target->GetMakefile(); + cmOStringStream e; + e << "Exporting the target \"" << target->GetName() << "\" is not " + "allowed since its linker language cannot be determined"; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } + const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); for(cmComputeLinkInformation::ItemVector::const_iterator li = |