summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-12-09 21:39:15 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-15 12:01:21 (GMT)
commitdcf9f4d2f71d7c608ce24b690d30d465df51dc71 (patch)
tree0868f3cd8176eb883063a77350864b70782b2dad /Source/cmGlobalNinjaGenerator.h
parent15467f12f796205f97721f43ae7d9ee7cdc47466 (diff)
downloadCMake-dcf9f4d2f71d7c608ce24b690d30d465df51dc71.zip
CMake-dcf9f4d2f71d7c608ce24b690d30d465df51dc71.tar.gz
CMake-dcf9f4d2f71d7c608ce24b690d30d465df51dc71.tar.bz2
Ninja Multi-Config: Add support for cross-config custom commands
Co-Author: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.h')
-rw-r--r--Source/cmGlobalNinjaGenerator.h45
1 files changed, 42 insertions, 3 deletions
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 8df0372..b30a64a 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -330,10 +330,14 @@ public:
cmNinjaTargetDepends depends);
void AppendTargetDependsClosure(cmGeneratorTarget const* target,
cmNinjaDeps& outputs,
- const std::string& config);
+ const std::string& config,
+ const std::string& fileConfig,
+ bool genexOutput);
void AppendTargetDependsClosure(cmGeneratorTarget const* target,
cmNinjaOuts& outputs,
- const std::string& config, bool omit_self);
+ const std::string& config,
+ const std::string& fileConfig,
+ bool genexOutput, bool omit_self);
void AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
@@ -430,6 +434,18 @@ public:
return this->DefaultConfigs;
}
+ const std::set<std::string>& GetPerConfigUtilityTargets() const
+ {
+ return this->PerConfigUtilityTargets;
+ }
+
+ void AddPerConfigUtilityTarget(const std::string& name)
+ {
+ this->PerConfigUtilityTargets.insert(name);
+ }
+
+ bool IsSingleConfigUtility(cmGeneratorTarget const* target) const;
+
protected:
void Generate() override;
@@ -523,6 +539,9 @@ private:
/// The mapping from source file to assumed dependencies.
std::map<std::string, std::set<std::string>> AssumedSourceDependencies;
+ /// Utility targets which have per-config outputs
+ std::set<std::string> PerConfigUtilityTargets;
+
struct TargetAlias
{
cmGeneratorTarget* GeneratorTarget;
@@ -563,7 +582,14 @@ private:
/// The set of custom commands we have seen.
std::set<cmCustomCommand const*> CustomCommands;
- std::map<cmGeneratorTarget const*, cmNinjaOuts> TargetDependsClosures;
+ struct TargetDependsClosureKey
+ {
+ cmGeneratorTarget const* Target;
+ std::string Config;
+ bool GenexOutput;
+ };
+
+ std::map<TargetDependsClosureKey, cmNinjaOuts> TargetDependsClosures;
TargetAliasMap TargetAliases;
@@ -572,6 +598,19 @@ private:
std::map<std::string, ByConfig> Configs;
cmNinjaDeps ByproductsForCleanTarget;
+
+ friend bool operator==(const ByConfig::TargetDependsClosureKey& lhs,
+ const ByConfig::TargetDependsClosureKey& rhs);
+ friend bool operator!=(const ByConfig::TargetDependsClosureKey& lhs,
+ const ByConfig::TargetDependsClosureKey& rhs);
+ friend bool operator<(const ByConfig::TargetDependsClosureKey& lhs,
+ const ByConfig::TargetDependsClosureKey& rhs);
+ friend bool operator>(const ByConfig::TargetDependsClosureKey& lhs,
+ const ByConfig::TargetDependsClosureKey& rhs);
+ friend bool operator<=(const ByConfig::TargetDependsClosureKey& lhs,
+ const ByConfig::TargetDependsClosureKey& rhs);
+ friend bool operator>=(const ByConfig::TargetDependsClosureKey& lhs,
+ const ByConfig::TargetDependsClosureKey& rhs);
};
class cmGlobalNinjaMultiGenerator : public cmGlobalNinjaGenerator