mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 21:30:01 -05:00
ead7117afd
-- Sort targets by name -- Generate a top-level project for each project command named as project.top.gpj Use the target set for the current project instead of assuming all targets -- Add support for building projects not in binary root -- Directly create files and pass ostream -- Do no generate project files for UTILITY targets; this was never supported -- Do no generate project files for OBJECT, SHARED, or MODULE libraries; this was never supported -- Update GHS tags to support project types NOTE: The default tag is changed to "" because "[ ]" is an invalid token in project file
123 lines
4.5 KiB
C++
123 lines
4.5 KiB
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#ifndef cmGhsMultiTargetGenerator_h
|
|
#define cmGhsMultiTargetGenerator_h
|
|
|
|
#include "cmGhsMultiGpj.h"
|
|
|
|
#include "cmTarget.h"
|
|
|
|
class cmCustomCommand;
|
|
class cmGeneratedFileStream;
|
|
class cmGeneratorTarget;
|
|
class cmGlobalGhsMultiGenerator;
|
|
class cmLocalGhsMultiGenerator;
|
|
class cmMakefile;
|
|
class cmSourceFile;
|
|
|
|
class cmGhsMultiTargetGenerator
|
|
{
|
|
public:
|
|
cmGhsMultiTargetGenerator(cmGeneratorTarget* target);
|
|
|
|
virtual ~cmGhsMultiTargetGenerator();
|
|
|
|
virtual void Generate();
|
|
|
|
bool IncludeThisTarget();
|
|
std::vector<cmSourceFile*> GetSources() const;
|
|
const char* GetAbsBuildFilePath() const
|
|
{
|
|
return this->AbsBuildFilePath.c_str();
|
|
}
|
|
const char* GetRelBuildFileName() const
|
|
{
|
|
return this->RelBuildFileName.c_str();
|
|
}
|
|
const char* GetAbsBuildFileName() const
|
|
{
|
|
return this->AbsBuildFileName.c_str();
|
|
}
|
|
const char* GetAbsOutputFileName() const
|
|
{
|
|
return this->AbsOutputFileName.c_str();
|
|
}
|
|
|
|
static std::string GetRelBuildFilePath(const cmGeneratorTarget* target);
|
|
static std::string GetAbsPathToRoot(const cmGeneratorTarget* target);
|
|
static std::string GetAbsBuildFilePath(const cmGeneratorTarget* target);
|
|
static std::string GetRelBuildFileName(const cmGeneratorTarget* target);
|
|
static std::string GetBuildFileName(const cmGeneratorTarget* target);
|
|
static std::string AddSlashIfNeededToPath(std::string const& input);
|
|
|
|
private:
|
|
cmGlobalGhsMultiGenerator* GetGlobalGenerator() const;
|
|
cmGeneratedFileStream* GetFolderBuildStreams()
|
|
{
|
|
return this->FolderBuildStreams[""];
|
|
};
|
|
void GenerateTarget();
|
|
|
|
bool IsTargetGroup() const { return this->TargetGroup; }
|
|
|
|
void WriteTypeSpecifics(std::ostream& fout, const std::string& config,
|
|
bool notKernel);
|
|
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,
|
|
bool const notKernel);
|
|
std::string GetDefines(const std::string& langugae,
|
|
std::string const& config);
|
|
|
|
void WriteIncludes(std::ostream& fout, const std::string& config,
|
|
const std::string& language);
|
|
void WriteTargetLinkLibraries(std::ostream& fout, std::string const& config,
|
|
std::string const& language);
|
|
void WriteCustomCommands(std::ostream& fout);
|
|
void WriteCustomCommandsHelper(
|
|
std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
|
|
cmTarget::CustomCommandType commandType);
|
|
void WriteSources(std::ostream& fout_proj);
|
|
static std::map<const cmSourceFile*, std::string> GetObjectNames(
|
|
std::vector<cmSourceFile*>* objectSources,
|
|
cmLocalGhsMultiGenerator* localGhsMultiGenerator,
|
|
cmGeneratorTarget* generatorTarget);
|
|
static void WriteObjectLangOverride(std::ostream* fout,
|
|
const cmSourceFile* sourceFile);
|
|
static void WriteObjectDir(std::ostream& fout, std::string const& dir);
|
|
std::string GetOutputDirectory(const std::string& config) const;
|
|
std::string GetOutputFilename(const std::string& config) const;
|
|
static std::string ComputeLongestObjectDirectory(
|
|
cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
|
|
cmGeneratorTarget* generatorTarget, cmSourceFile* const sourceFile);
|
|
|
|
bool IsNotKernel(std::string const& config, const std::string& language);
|
|
static bool DetermineIfTargetGroup(const cmGeneratorTarget* target);
|
|
bool DetermineIfDynamicDownload(std::string const& config,
|
|
const std::string& language);
|
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
|
cmLocalGhsMultiGenerator* LocalGenerator;
|
|
cmMakefile* Makefile;
|
|
std::string AbsBuildFilePath;
|
|
std::string RelBuildFilePath;
|
|
std::string AbsBuildFileName;
|
|
std::string RelBuildFileName;
|
|
std::string RelOutputFileName;
|
|
std::string AbsOutputFileName;
|
|
std::map<std::string, cmGeneratedFileStream*> FolderBuildStreams;
|
|
bool TargetGroup;
|
|
bool DynamicDownload;
|
|
static std::string const DDOption;
|
|
std::map<std::string, std::string> FlagsByLanguage;
|
|
std::map<std::string, std::string> DefinesByLanguage;
|
|
|
|
GhsMultiGpj::Types TagType;
|
|
std::string const Name;
|
|
};
|
|
|
|
#endif // ! cmGhsMultiTargetGenerator_h
|