Skip to content
Snippets Groups Projects
Commit 7e9f908e authored by Brad King's avatar Brad King
Browse files

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.
parent 3b09398a
No related branches found
No related tags found
No related merge requests found
......@@ -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
{
......
1
^CMake Error at CustomTarget.cmake:[0-9]+ \(export\):
export given custom target "CustomTarget" which may not be exported.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
add_custom_target(CustomTarget)
export(TARGETS CustomTarget FILE somefile.cmake)
include(RunCMake)
run_cmake(CustomTarget)
run_cmake(TargetNotFound)
run_cmake(AppendExport)
run_cmake(OldIface)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment