diff options
Diffstat (limited to 'Source/cmCPluginAPI.cxx')
-rw-r--r-- | Source/cmCPluginAPI.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 3a08aea..2498ecb 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -162,7 +162,14 @@ void CCONV cmAddLinkDirectoryForTarget(void* arg, const char* tgt, const char* d) { cmMakefile* mf = static_cast<cmMakefile*>(arg); - mf->AddLinkDirectoryForTarget(tgt, d); + cmTarget* t = mf->FindLocalNonAliasTarget(tgt); + if (!t) { + cmSystemTools::Error( + "Attempt to add link directories to non-existent target: ", tgt, + " for directory ", d); + return; + } + t->AddLinkDirectory(d); } void CCONV cmAddExecutable(void* arg, const char* exename, int numSrcs, |