diff options
author | Brad King <brad.king@kitware.com> | 2018-01-29 15:20:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-29 15:51:22 (GMT) |
commit | 79f22e84089e3f7a29cfea3275af6fafc5d3c091 (patch) | |
tree | 5f83790921f2ea838e6ffdf169392a0b56faccb2 /Source/cmLocalCommonGenerator.cxx | |
parent | 92cd3d06772ada13935790d66927ab4663c7d628 (diff) | |
download | CMake-79f22e84089e3f7a29cfea3275af6fafc5d3c091.zip CMake-79f22e84089e3f7a29cfea3275af6fafc5d3c091.tar.gz CMake-79f22e84089e3f7a29cfea3275af6fafc5d3c091.tar.bz2 |
Makefile,Ninja: De-duplicate ComputeObjectFilenames method
Move the method implementation up to `cmLocalCommonGenerator`
to avoid duplicating it in each generator.
Diffstat (limited to 'Source/cmLocalCommonGenerator.cxx')
-rw-r--r-- | Source/cmLocalCommonGenerator.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 50ebfa1..5a43f2e 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalCommonGenerator.h" +#include <utility> #include <vector> #include "cmGeneratorTarget.h" @@ -76,3 +77,17 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags( return flags; } + +void cmLocalCommonGenerator::ComputeObjectFilenames( + std::map<cmSourceFile const*, std::string>& mapping, + cmGeneratorTarget const* gt) +{ + // Determine if these object files should use a custom extension + char const* custom_ext = gt->GetCustomObjectExtension(); + for (auto& si : mapping) { + cmSourceFile const* sf = si.first; + bool keptSourceExtension; + si.second = this->GetObjectFileNameWithoutTarget( + *sf, gt->ObjectDirectory, &keptSourceExtension, custom_ext); + } +} |