summaryrefslogtreecommitdiff
path: root/Source/cmFileAPICodemodel.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-12 11:22:36 -0400
committerBrad King <brad.king@kitware.com>2019-07-12 17:29:40 -0400
commit22d3eb5d5e4ce9c6371ab709655928552453fbda (patch)
treeca27b28cfa41f5aa453e390743cfe8e2ec04138b /Source/cmFileAPICodemodel.cxx
parentf9e0cf64176628d07871741da2c6f585f52c4e39 (diff)
downloadcmake-22d3eb5d5e4ce9c6371ab709655928552453fbda.tar.gz
Refactor checks for whether a target has an import library
Use `HasImportLibrary` for such checks.
Diffstat (limited to 'Source/cmFileAPICodemodel.cxx')
-rw-r--r--Source/cmFileAPICodemodel.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 73b4123b19..7b916cd186 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -1076,17 +1076,16 @@ Json::Value Target::DumpArtifacts()
}
// Add Windows-specific artifacts produced by the linker.
+ if (this->GT->HasImportLibrary(this->Config)) {
+ Json::Value artifact = Json::objectValue;
+ artifact["path"] =
+ RelativeIfUnder(this->TopBuild,
+ this->GT->GetFullPath(
+ this->Config, cmStateEnums::ImportLibraryArtifact));
+ artifacts.append(std::move(artifact)); // NOLINT(*)
+ }
if (this->GT->IsDLLPlatform() &&
this->GT->GetType() != cmStateEnums::STATIC_LIBRARY) {
- if (this->GT->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->GT->IsExecutableWithExports()) {
- Json::Value artifact = Json::objectValue;
- artifact["path"] =
- RelativeIfUnder(this->TopBuild,
- this->GT->GetFullPath(
- this->Config, cmStateEnums::ImportLibraryArtifact));
- artifacts.append(std::move(artifact)); // NOLINT(*)
- }
cmGeneratorTarget::OutputInfo const* output =
this->GT->GetOutputInfo(this->Config);
if (output && !output->PdbDir.empty()) {