https://github.com/Kitware/CMake
Revision c111d440cef08f744f910ebdca063f1c63586e84 authored by Brad King on 08 June 2022, 16:37:48 UTC, committed by Brad King on 08 June 2022, 19:13:27 UTC
The ExternalProject module has long used the generator-specific
placeholder in the `${CMAKE_CFG_INTDIR}` variable to express per-config
stamp file paths in multi-config generators.  Now that most generators
support generator expressions in custom command outputs, we can use
the `$<CONFIG>` genex instead.

In particular, this fixes cross-config `BUILD_BYPRODUCTS` with the Ninja
Multi-Config generator.

Fixes: #23595
1 parent aaf5353
Raw File
Tip revision: c111d440cef08f744f910ebdca063f1c63586e84 authored by Brad King on 08 June 2022, 16:37:48 UTC
ExternalProject: Express per-config step stamp file paths using CONFIG genex
Tip revision: c111d44
cmExprParserHelper.h
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#pragma once

#include "cmConfigure.h" // IWYU pragma: keep

#include <string>
#include <vector>

#include <cm3p/kwiml/int.h>

class cmExprParserHelper
{
public:
  struct ParserType
  {
    KWIML_INT_int64_t Number;
  };

  cmExprParserHelper();
  ~cmExprParserHelper();

  int ParseString(const char* str, int verb);

  int LexInput(char* buf, int maxlen);
  void Error(const char* str);

  void SetResult(KWIML_INT_int64_t value);

  KWIML_INT_int64_t GetResult() const { return this->Result; }

  const char* GetError() { return this->ErrorString.c_str(); }

  void UnexpectedChar(char c);

  std::string const& GetWarning() const { return this->WarningString; }

private:
  std::string::size_type InputBufferPos;
  std::string InputBuffer;
  std::vector<char> OutputBuffer;
  int CurrentLine;
  int Verbose;

  void Print(const char* place, const char* str);

  void SetError(std::string errorString);

  KWIML_INT_int64_t Result;
  const char* FileName;
  long FileLine;
  std::string ErrorString;
  std::string WarningString;
};

#define YYSTYPE cmExprParserHelper::ParserType
#define YYSTYPE_IS_DECLARED
#define YY_EXTRA_TYPE cmExprParserHelper*
#define YY_DECL int cmExpr_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner)
back to top