Ninja Multi-Config: Add support for cross-config custom commands

Co-Author: Brad King <brad.king@kitware.com>
This commit is contained in:
Kyle Edwards
2020-12-09 16:39:15 -05:00
committed by Brad King
parent 15467f12f7
commit dcf9f4d2f7
17 changed files with 548 additions and 106 deletions

View File

@@ -9,6 +9,8 @@
#include <utility>
#include <vector>
#include <cm/optional>
#include "cmCustomCommandLines.h"
#include "cmListFileCache.h"
@@ -18,7 +20,8 @@ class cmLocalGenerator;
class cmCustomCommandGenerator
{
cmCustomCommand const* CC;
std::string Config;
std::string OutputConfig;
std::string CommandConfig;
cmLocalGenerator* LG;
bool OldStyle;
bool MakeVars;
@@ -36,7 +39,8 @@ class cmCustomCommandGenerator
public:
cmCustomCommandGenerator(cmCustomCommand const& cc, std::string config,
cmLocalGenerator* lg, bool transformDepfile = true);
cmLocalGenerator* lg, bool transformDepfile = true,
cm::optional<std::string> crossConfig = {});
cmCustomCommandGenerator(const cmCustomCommandGenerator&) = delete;
cmCustomCommandGenerator(cmCustomCommandGenerator&&) = default;
cmCustomCommandGenerator& operator=(const cmCustomCommandGenerator&) =
@@ -55,4 +59,7 @@ public:
bool HasOnlyEmptyCommandLines() const;
std::string GetFullDepfile() const;
std::string GetInternalDepfile() const;
const std::string& GetOutputConfig() const { return this->OutputConfig; }
const std::string& GetCommandConfig() const { return this->CommandConfig; }
};