diff options
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5a8c0aa..94e0833 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -170,6 +170,10 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() // This is an external object file. Just add it. this->ExternalObjects.push_back((*source)->GetFullPath()); } + else if(cmSystemTools::UpperCase((*source)->GetExtension()) == "DEF") + { + this->ModuleDefinitionFile = (*source)->GetFullPath(); + } else { // We only get here if a source file is not an external object @@ -1734,3 +1738,27 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags) } } } + +//---------------------------------------------------------------------------- +void cmMakefileTargetGenerator::AddModuleDefinitionFlag(std::string& flags) +{ + if(this->ModuleDefinitionFile.empty()) + { + return; + } + + // TODO: Create a per-language flag variable. + const char* defFileFlag = + this->Makefile->GetDefinition("CMAKE_LINK_DEF_FILE_FLAG"); + if(!defFileFlag) + { + return; + } + + // Append the flag and value. + std::string flag = defFileFlag; + flag += this->Convert(this->ModuleDefinitionFile.c_str(), + cmLocalGenerator::START_OUTPUT, + cmLocalGenerator::SHELL); + this->LocalGenerator->AppendFlags(flags, flag.c_str()); +} |