summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r--Source/cmCommonTargetGenerator.cxx15
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 239582f..fd1ad36 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -26,7 +26,6 @@ cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
, GlobalGenerator(static_cast<cmGlobalCommonGenerator*>(
gt->LocalGenerator->GetGlobalGenerator()))
, ConfigName(LocalGenerator->GetConfigName())
- , ModuleDefinitionFile(GeneratorTarget->GetModuleDefinitionFile(ConfigName))
{
}
@@ -63,14 +62,9 @@ void cmCommonTargetGenerator::AddFeatureFlags(std::string& flags,
void cmCommonTargetGenerator::AddModuleDefinitionFlag(
cmLinkLineComputer* linkLineComputer, std::string& flags)
{
- // A module definition file only makes sense on certain target types.
- if (this->GeneratorTarget->GetType() != cmStateEnums::SHARED_LIBRARY &&
- this->GeneratorTarget->GetType() != cmStateEnums::MODULE_LIBRARY &&
- this->GeneratorTarget->GetType() != cmStateEnums::EXECUTABLE) {
- return;
- }
-
- if (!this->ModuleDefinitionFile) {
+ cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
+ this->GeneratorTarget->GetModuleDefinitionInfo(this->GetConfigName());
+ if (!mdi || mdi->DefFile.empty()) {
return;
}
@@ -85,8 +79,7 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(
// vs6's "cl -link" pass it to the linker.
std::string flag = defFileFlag;
flag += this->LocalGenerator->ConvertToOutputFormat(
- linkLineComputer->ConvertToLinkReference(
- this->ModuleDefinitionFile->GetFullPath()),
+ linkLineComputer->ConvertToLinkReference(mdi->DefFile),
cmOutputConverter::SHELL);
this->LocalGenerator->AppendFlags(flags, flag);
}