mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-27 09:29:15 -05:00
Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIX
Use `CMAKE_IMPORT_LIBRARY_SUFFIX` to identify platforms that have DLL import libraries rather than memorizing a list of platform names. Fixes: #16801
This commit is contained in:
@@ -132,8 +132,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
|
|||||||
this->SourceEntries, true);
|
this->SourceEntries, true);
|
||||||
|
|
||||||
this->DLLPlatform =
|
this->DLLPlatform =
|
||||||
(this->Makefile->IsOn("WIN32") || this->Makefile->IsOn("CYGWIN") ||
|
strcmp(this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
|
||||||
this->Makefile->IsOn("MINGW"));
|
"") != 0;
|
||||||
|
|
||||||
this->PolicyMap = t->PolicyMap;
|
this->PolicyMap = t->PolicyMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "cmsys/Glob.hxx"
|
#include "cmsys/Glob.hxx"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "cmAlgorithms.h"
|
#include "cmAlgorithms.h"
|
||||||
@@ -334,8 +335,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
|
|||||||
|
|
||||||
// Check whether this is a DLL platform.
|
// Check whether this is a DLL platform.
|
||||||
bool dll_platform =
|
bool dll_platform =
|
||||||
(this->Makefile->IsOn("WIN32") || this->Makefile->IsOn("CYGWIN") ||
|
strcmp(this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
|
||||||
this->Makefile->IsOn("MINGW"));
|
"") != 0;
|
||||||
|
|
||||||
for (std::string const& tgt : targetList.GetVector()) {
|
for (std::string const& tgt : targetList.GetVector()) {
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -196,8 +196,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
|||||||
|
|
||||||
// Check whether this is a DLL platform.
|
// Check whether this is a DLL platform.
|
||||||
this->DLLPlatform =
|
this->DLLPlatform =
|
||||||
(this->Makefile->IsOn("WIN32") || this->Makefile->IsOn("CYGWIN") ||
|
strcmp(this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
|
||||||
this->Makefile->IsOn("MINGW"));
|
"") != 0;
|
||||||
|
|
||||||
// Check whether we are targeting an Android platform.
|
// Check whether we are targeting an Android platform.
|
||||||
this->IsAndroid =
|
this->IsAndroid =
|
||||||
|
|||||||
Reference in New Issue
Block a user