diff options
author | Brad King <brad.king@kitware.com> | 2012-04-02 14:55:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-04-02 14:58:56 (GMT) |
commit | d2c764ad8db1a2d920e43f5c78d4ff4b1f643cee (patch) | |
tree | d8d60bf3f53711fb405b6d6166ecdff727cea995 /Source/cmNinjaTargetGenerator.cxx | |
parent | a2514f15fae34abb6f29dddf6f5cfe8b171a8035 (diff) | |
download | CMake-d2c764ad8db1a2d920e43f5c78d4ff4b1f643cee.zip CMake-d2c764ad8db1a2d920e43f5c78d4ff4b1f643cee.tar.gz CMake-d2c764ad8db1a2d920e43f5c78d4ff4b1f643cee.tar.bz2 |
Ninja: Fix module .def file path conversion
Refactoring in commit a2514f15 (Simplify cmNinjaTargetGenerator using
cmGeneratorTarget, 2012-03-13) accidentally removed mapping of .def file
paths through ConvertToNinjaPath (via GetSourceFilePath). Take the
ModuleDefinitionFile value from cmGeneratorTarget and map it correctly
through ConvertToNinjaPath.
In addition to generating cleaner paths in the ninja build files this
correctly links up references to a generated .def file with the custom
command output that produces it.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 23662d9..3f7c925 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -234,9 +234,9 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath()); // Add a dependency on the link definitions file, if any. - if(!this->GeneratorTarget->ModuleDefinitionFile.empty()) + if(!this->ModuleDefinitionFile.empty()) { - result.push_back(this->GeneratorTarget->ModuleDefinitionFile); + result.push_back(this->ModuleDefinitionFile); } return result; @@ -400,6 +400,11 @@ cmNinjaTargetGenerator { this->WriteObjectBuildStatement(*si); } + if(!this->GeneratorTarget->ModuleDefinitionFile.empty()) + { + this->ModuleDefinitionFile = this->ConvertToNinjaPath( + this->GeneratorTarget->ModuleDefinitionFile.c_str()); + } this->GetBuildFileStream() << "\n"; } @@ -478,7 +483,7 @@ void cmNinjaTargetGenerator ::AddModuleDefinitionFlag(std::string& flags) { - if(this->GeneratorTarget->ModuleDefinitionFile.empty()) + if(this->ModuleDefinitionFile.empty()) { return; } @@ -495,6 +500,6 @@ cmNinjaTargetGenerator // vs6's "cl -link" pass it to the linker. std::string flag = defFileFlag; flag += (this->LocalGenerator->ConvertToLinkReference( - this->GeneratorTarget->ModuleDefinitionFile.c_str())); + this->ModuleDefinitionFile.c_str())); this->LocalGenerator->AppendFlags(flags, flag.c_str()); } |