|
@@ -9,16 +9,10 @@
|
|
|
#include <iterator>
|
|
#include <iterator>
|
|
|
#include <utility>
|
|
#include <utility>
|
|
|
|
|
|
|
|
|
|
+#include "cmCMakePresetsFileInternal.h"
|
|
|
#include "cmStringAlgorithms.h"
|
|
#include "cmStringAlgorithms.h"
|
|
|
#include "cmSystemTools.h"
|
|
#include "cmSystemTools.h"
|
|
|
|
|
|
|
|
-#define CHECK_OK(expr) \
|
|
|
|
|
- { \
|
|
|
|
|
- auto _result = expr; \
|
|
|
|
|
- if (_result != ReadFileResult::READ_OK) \
|
|
|
|
|
- return _result; \
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
#define CHECK_EXPAND(out, field, expanders, version) \
|
|
#define CHECK_EXPAND(out, field, expanders, version) \
|
|
|
{ \
|
|
{ \
|
|
|
switch (ExpandMacros(field, expanders, version)) { \
|
|
switch (ExpandMacros(field, expanders, version)) { \
|
|
@@ -44,6 +38,8 @@ using ReadFileResult = cmCMakePresetsFile::ReadFileResult;
|
|
|
using ConfigurePreset = cmCMakePresetsFile::ConfigurePreset;
|
|
using ConfigurePreset = cmCMakePresetsFile::ConfigurePreset;
|
|
|
using BuildPreset = cmCMakePresetsFile::BuildPreset;
|
|
using BuildPreset = cmCMakePresetsFile::BuildPreset;
|
|
|
using TestPreset = cmCMakePresetsFile::TestPreset;
|
|
using TestPreset = cmCMakePresetsFile::TestPreset;
|
|
|
|
|
+using ExpandMacroResult = cmCMakePresetsFileInternal::ExpandMacroResult;
|
|
|
|
|
+using MacroExpander = cmCMakePresetsFileInternal::MacroExpander;
|
|
|
|
|
|
|
|
void InheritString(std::string& child, const std::string& parent)
|
|
void InheritString(std::string& child, const std::string& parent)
|
|
|
{
|
|
{
|
|
@@ -166,16 +162,6 @@ bool IsValidMacroNamespace(const std::string& str)
|
|
|
[&str](const char* prefix) -> bool { return str == prefix; });
|
|
[&str](const char* prefix) -> bool { return str == prefix; });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-enum class ExpandMacroResult
|
|
|
|
|
-{
|
|
|
|
|
- Ok,
|
|
|
|
|
- Ignore,
|
|
|
|
|
- Error,
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-using MacroExpander = std::function<ExpandMacroResult(
|
|
|
|
|
- const std::string&, const std::string&, std::string&, int version)>;
|
|
|
|
|
-
|
|
|
|
|
ExpandMacroResult VisitEnv(std::string& value, CycleStatus& status,
|
|
ExpandMacroResult VisitEnv(std::string& value, CycleStatus& status,
|
|
|
const std::vector<MacroExpander>& macroExpanders,
|
|
const std::vector<MacroExpander>& macroExpanders,
|
|
|
int version);
|
|
int version);
|