mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-27 17:39:51 -05:00
Record backtrace in cmCustomCommand
This will be used to report custom command errors to the user with a backtrace pointing at the add_custom_command or add_custom_target call.
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#define cmCustomCommand_h
|
||||
|
||||
#include "cmStandardIncludes.h"
|
||||
class cmMakefile;
|
||||
class cmListFileBacktrace;
|
||||
|
||||
/** \class cmCustomCommand
|
||||
* \brief A class to encapsulate a custom command
|
||||
@@ -27,12 +29,15 @@ public:
|
||||
cmCustomCommand(const cmCustomCommand& r);
|
||||
|
||||
/** Main constructor specifies all information for the command. */
|
||||
cmCustomCommand(const std::vector<std::string>& outputs,
|
||||
cmCustomCommand(cmMakefile* mf,
|
||||
const std::vector<std::string>& outputs,
|
||||
const std::vector<std::string>& depends,
|
||||
const cmCustomCommandLines& commandLines,
|
||||
const char* comment,
|
||||
const char* workingDirectory);
|
||||
|
||||
~cmCustomCommand();
|
||||
|
||||
/** Get the output file produced by the command. */
|
||||
const std::vector<std::string>& GetOutputs() const;
|
||||
|
||||
@@ -63,6 +68,9 @@ public:
|
||||
bool GetEscapeAllowMakeVars() const;
|
||||
void SetEscapeAllowMakeVars(bool b);
|
||||
|
||||
/** Backtrace of the command that created this custom command. */
|
||||
cmListFileBacktrace const& GetBacktrace() const;
|
||||
|
||||
typedef std::pair<cmStdString, cmStdString> ImplicitDependsPair;
|
||||
class ImplicitDependsList: public std::vector<ImplicitDependsPair> {};
|
||||
void SetImplicitDepends(ImplicitDependsList const&);
|
||||
@@ -78,6 +86,7 @@ private:
|
||||
std::string WorkingDirectory;
|
||||
bool EscapeAllowMakeVars;
|
||||
bool EscapeOldStyle;
|
||||
cmListFileBacktrace* Backtrace;
|
||||
ImplicitDependsList ImplicitDepends;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user