|
@@ -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);
|
|
|
}
|