mirror of
https://github.com/Kitware/CMake.git
synced 2025-06-15 16:39:26 +08:00

GHS doesn't follow the binary structure that VS or Makefiles use Also setting binary location outputs do not work -- Update to act like Visual Studio Generator and use its project layout -- Fix open/close issues where open() was used instead of Open() Now passes the file handle to all function that require it -- Avoid triggering MULTI reloads; use SetCopyIfDifferent mode
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#include "cmLocalGhsMultiGenerator.h"
|
|
|
|
#include "cmGeneratedFileStream.h"
|
|
#include "cmGeneratorTarget.h"
|
|
#include "cmGhsMultiTargetGenerator.h"
|
|
#include "cmGlobalGhsMultiGenerator.h"
|
|
#include "cmMakefile.h"
|
|
|
|
cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator(cmGlobalGenerator* gg,
|
|
cmMakefile* mf)
|
|
: cmLocalGenerator(gg, mf)
|
|
{
|
|
}
|
|
|
|
cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator()
|
|
{
|
|
}
|
|
|
|
void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst(
|
|
cmGeneratorTarget* target, std::vector<cmGeneratorTarget*>& remaining)
|
|
{
|
|
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
|
|
return;
|
|
}
|
|
// Find this target in the list of remaining targets.
|
|
auto it = std::find(remaining.begin(), remaining.end(), target);
|
|
if (it == remaining.end()) {
|
|
// This target was already handled.
|
|
return;
|
|
}
|
|
// Remove this target from the list of remaining targets because
|
|
// we are handling it now.
|
|
*it = nullptr;
|
|
|
|
cmGhsMultiTargetGenerator tg(target);
|
|
tg.Generate();
|
|
}
|
|
|
|
void cmLocalGhsMultiGenerator::Generate()
|
|
{
|
|
std::vector<cmGeneratorTarget*> remaining = this->GetGeneratorTargets();
|
|
for (auto& t : remaining) {
|
|
if (t) {
|
|
GenerateTargetsDepthFirst(t, remaining);
|
|
}
|
|
}
|
|
}
|