summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index ff8b604..e017b29 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -2,8 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMakefileLibraryTargetGenerator.h"
-#include <cmConfigure.h> // IWYU pragma: keep
-
+#include <algorithm>
#include <sstream>
#include <vector>
@@ -130,14 +129,9 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
{
std::string linkLanguage =
this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
- std::string linkRuleVar = "CMAKE_";
- linkRuleVar += linkLanguage;
- linkRuleVar += "_CREATE_STATIC_LIBRARY";
- if (this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION") &&
- this->Makefile->GetDefinition(linkRuleVar + "_IPO")) {
- linkRuleVar += "_IPO";
- }
+ std::string linkRuleVar = this->GeneratorTarget->GetCreateRuleVariable(
+ linkLanguage, this->ConfigName);
std::string extraFlags;
this->LocalGenerator->GetStaticLibraryFlags(
@@ -520,7 +514,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
cmSystemTools::MakeDirectory(outpath.c_str());
outpath += "/";
if (!targetNameImport.empty()) {
- outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
+ outpathImp = this->GeneratorTarget->GetDirectory(
+ this->ConfigName, cmStateEnums::ImportLibraryArtifact);
cmSystemTools::MakeDirectory(outpathImp.c_str());
outpathImp += "/";
}
@@ -677,18 +672,30 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
std::string arCreateVar = "CMAKE_";
arCreateVar += linkLanguage;
arCreateVar += "_ARCHIVE_CREATE";
+
+ arCreateVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
+ arCreateVar, this->ConfigName);
+
if (const char* rule = this->Makefile->GetDefinition(arCreateVar)) {
cmSystemTools::ExpandListArgument(rule, archiveCreateCommands);
}
std::string arAppendVar = "CMAKE_";
arAppendVar += linkLanguage;
arAppendVar += "_ARCHIVE_APPEND";
+
+ arAppendVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
+ arAppendVar, this->ConfigName);
+
if (const char* rule = this->Makefile->GetDefinition(arAppendVar)) {
cmSystemTools::ExpandListArgument(rule, archiveAppendCommands);
}
std::string arFinishVar = "CMAKE_";
arFinishVar += linkLanguage;
arFinishVar += "_ARCHIVE_FINISH";
+
+ arFinishVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
+ arFinishVar, this->ConfigName);
+
if (const char* rule = this->Makefile->GetDefinition(arFinishVar)) {
cmSystemTools::ExpandListArgument(rule, archiveFinishCommands);
}
@@ -751,10 +758,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
}
// maybe create .def file from list of objects
- if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY &&
- this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) {
- this->GenDefFile(real_link_commands, linkFlags);
- }
+ this->GenDefFile(real_link_commands);
std::string manifests = this->GetManifests();