1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-09 14:57:08 +08:00
CMake/Source/cmGhsMultiTargetGenerator.h
Kitware Robot bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00

84 lines
3.1 KiB
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
#include <iosfwd>
#include <map>
#include <set>
#include <string>
#include <vector>
#include "cmGhsMultiGpj.h"
class cmCustomCommand;
class cmCustomCommandGenerator;
class cmGeneratorTarget;
class cmGlobalGhsMultiGenerator;
class cmLocalGhsMultiGenerator;
class cmMakefile;
class cmSourceFile;
class cmGhsMultiTargetGenerator
{
public:
cmGhsMultiTargetGenerator(cmGeneratorTarget* target);
virtual ~cmGhsMultiTargetGenerator();
virtual void Generate();
private:
cmGlobalGhsMultiGenerator* GetGlobalGenerator() const;
void GenerateTarget();
void WriteTargetSpecifics(std::ostream& fout, const std::string& config);
void WriteCompilerFlags(std::ostream& fout, const std::string& config,
const std::string& language);
void WriteCompilerDefinitions(std::ostream& fout, const std::string& config,
const std::string& language);
void SetCompilerFlags(std::string const& config,
const std::string& language);
std::string GetDefines(const std::string& language,
std::string const& config);
void WriteIncludes(std::ostream& fout, const std::string& config,
const std::string& language);
void WriteTargetLinkLine(std::ostream& fout, std::string const& config);
void WriteBuildEvents(std::ostream& fout);
void WriteBuildEventsHelper(std::ostream& fout,
const std::vector<cmCustomCommand>& ccv,
std::string const& name, std::string const& cmd);
void WriteCustomCommandsHelper(std::ostream& fout,
cmCustomCommandGenerator const& ccg);
void WriteCustomCommandLine(std::ostream& fout, std::string& fname,
cmCustomCommandGenerator const& ccg);
bool ComputeCustomCommandOrder(std::vector<cmSourceFile const*>& order);
bool VisitCustomCommand(std::set<cmSourceFile const*>& temp,
std::set<cmSourceFile const*>& perm,
std::vector<cmSourceFile const*>& order,
cmSourceFile const* sf);
void WriteSources(std::ostream& fout_proj);
void WriteSourceProperty(std::ostream& fout, const cmSourceFile* sf,
std::string const& propName,
std::string const& propFlag);
static void WriteObjectLangOverride(std::ostream& fout,
const cmSourceFile* sourceFile);
bool DetermineIfIntegrityApp();
cmGeneratorTarget* GeneratorTarget;
cmLocalGhsMultiGenerator* LocalGenerator;
cmMakefile* Makefile;
std::map<std::string, std::string> FlagsByLanguage;
std::map<std::string, std::string> DefinesByLanguage;
std::string TargetNameReal;
GhsMultiGpj::Types TagType;
std::string const Name;
std::string ConfigName; /* CMAKE_BUILD_TYPE */
bool const CmdWindowsShell; /* custom commands run in cmd.exe or /bin/sh */
};