summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGhsMultiGenerator.h
diff options
context:
space:
mode:
authorFred Baksik <frodak17@gmail.com>2019-04-08 13:55:34 (GMT)
committerFred Baksik <frodak17@gmail.com>2019-04-11 17:15:50 (GMT)
commit5d2e1404bdfa83eeae5b361bd7d8a882aadc7242 (patch)
tree8aa8c0f88ed78d8fc15031587655c396813247b5 /Source/cmGlobalGhsMultiGenerator.h
parentb6bfa7eeb29937fbed44153518abfa4f28b9aa62 (diff)
downloadCMake-5d2e1404bdfa83eeae5b361bd7d8a882aadc7242.zip
CMake-5d2e1404bdfa83eeae5b361bd7d8a882aadc7242.tar.gz
CMake-5d2e1404bdfa83eeae5b361bd7d8a882aadc7242.tar.bz2
GHS: Update project layout to build targets correctly
-- Restructure projects and files to support proper building of targets Build order is determined by hierarchy of project files and folders Custom targets may have been run multiple times in the original file / folder structure -- Default to build targets that are part of ALL target -- List all known targets for this project Includes global targets for ALL_BUILD and INSTALL -- Compute build order for building targets
Diffstat (limited to 'Source/cmGlobalGhsMultiGenerator.h')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h71
1 files changed, 40 insertions, 31 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 5027a7c..a964af8 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -78,23 +78,7 @@ public:
// Write the common disclaimer text at the top of each build file.
void WriteFileHeader(std::ostream& fout);
- // Target dependency sorting
- class TargetSet : public std::set<cmGeneratorTarget const*>
- {
- };
- class TargetCompare
- {
- std::string First;
-
- public:
- TargetCompare(std::string first)
- : First(std::move(first))
- {
- }
- bool operator()(cmGeneratorTarget const* l,
- cmGeneratorTarget const* r) const;
- };
- class OrderedTargetDependSet;
+ const char* GetInstallTargetName() const override { return "install"; }
protected:
void Generate() override;
@@ -111,30 +95,55 @@ private:
/* top-level project */
void OutputTopLevelProject(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
- void WriteTopLevelProject(std::ostream& fout, cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators);
- void WriteMacros(std::ostream& fout);
+ void WriteTopLevelProject(std::ostream& fout, cmLocalGenerator* root);
+ void WriteMacros(std::ostream& fout, cmLocalGenerator* root);
void WriteHighLevelDirectives(cmLocalGenerator* root, std::ostream& fout);
- void WriteSubProjects(std::ostream& fout, cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators);
- void WriteTargetProjects(std::ostream& fout, cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators,
- bool proj);
- void WriteDefaultProject(std::ostream& fout, cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>& generators);
+ void WriteSubProjects(std::ostream& fout, cmLocalGenerator* root);
+ void WriteTargets(cmLocalGenerator* root);
+ void WriteProjects(cmLocalGenerator* root);
void WriteProjectLine(std::ostream& fout, cmGeneratorTarget const* target,
- cmLocalGenerator* root, std::string& rootBinaryDir,
- bool proj);
+ cmLocalGenerator* root, std::string& rootBinaryDir);
+ void WriteProjectRefLine(std::ostream& fout, cmGeneratorTarget const* target,
+ cmLocalGenerator* root, std::string& rootBinaryDir);
void WriteCustomRuleBOD(std::ostream& fout);
void WriteCustomTargetBOD(std::ostream& fout);
+ void WriteAllTarget(cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*>& generators);
- std::string trimQuotes(std::string const& str);
+ std::string TrimQuotes(std::string const& str);
std::string OsDir;
static const char* DEFAULT_BUILD_PROGRAM;
static const char* DEFAULT_TOOLSET_ROOT;
- std::vector<cmGeneratorTarget const*> DefaultTargets;
+
+ bool ComputeTargetBuildOrder(cmGeneratorTarget const* tgt,
+ std::vector<cmGeneratorTarget const*>& build);
+ bool ComputeTargetBuildOrder(std::vector<cmGeneratorTarget const*>& tgt,
+ std::vector<cmGeneratorTarget const*>& build);
+ bool VisitTarget(std::set<cmGeneratorTarget const*>& temp,
+ std::set<cmGeneratorTarget const*>& perm,
+ std::vector<cmGeneratorTarget const*>& order,
+ cmGeneratorTarget const* ti);
+
std::vector<cmGeneratorTarget const*> ProjectTargets;
+
+ // Target sorting
+ class TargetSet : public std::set<cmGeneratorTarget const*>
+ {
+ };
+ class TargetCompare
+ {
+ std::string First;
+
+ public:
+ TargetCompare(std::string first)
+ : First(std::move(first))
+ {
+ }
+ bool operator()(cmGeneratorTarget const* l,
+ cmGeneratorTarget const* r) const;
+ };
+ class OrderedTargetDependSet;
};
class cmGlobalGhsMultiGenerator::OrderedTargetDependSet