Revision 6fd9c68ed02d6b1dc013a6984f890d2c9457b1c8 authored by Brad King on 16 March 2021, 13:34:51 UTC, committed by Brad King on 16 March 2021, 13:37:35 UTC
Since commit fb18215904 (Ninja: clean ninja metadata once generated,
2019-05-13, v3.17.0-rc1~207^2) we recompact the ninja deps log during
regeneration.  That does not make sense during a build, so skip it if we
are regenerating during a build.

This problem went unnoticed previously because on non-Windows platforms
the deps log is just overwritten again by the outer build.  On Windows
platforms, recompaction during the build fails, but we did not actually
try to do that until commit 11f4259362 (Ninja: Clean metadata after
regen during build on Windows with 1.10.2+, 2020-11-30, v3.19.2~29^2~1).

Fixes: #21916
1 parent 22612dd
Raw File
cmTest.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 "cmListFileCache.h"
#include "cmPropertyMap.h"

class cmMakefile;

/** \class cmTest
 * \brief Represent a test
 *
 * cmTest is representation of a test.
 */
class cmTest
{
public:
  /**
   */
  cmTest(cmMakefile* mf);
  ~cmTest();

  //! Set the test name
  void SetName(const std::string& name);
  std::string GetName() const { return this->Name; }

  void SetCommand(std::vector<std::string> const& command);
  std::vector<std::string> const& GetCommand() const { return this->Command; }

  //! Set/Get a property of this source file
  void SetProperty(const std::string& prop, const char* value);
  void AppendProperty(const std::string& prop, const std::string& value,
                      bool asString = false);
  const char* GetProperty(const std::string& prop) const;
  bool GetPropertyAsBool(const std::string& prop) const;
  cmPropertyMap& GetProperties() { return this->Properties; }

  /** Get the cmMakefile instance that owns this test.  */
  cmMakefile* GetMakefile() { return this->Makefile; }

  /** Get the backtrace of the command that created this test.  */
  cmListFileBacktrace const& GetBacktrace() const;

  /** Get/Set whether this is an old-style test.  */
  bool GetOldStyle() const { return this->OldStyle; }
  void SetOldStyle(bool b) { this->OldStyle = b; }

  /** Set/Get whether lists in command lines should be expanded. */
  bool GetCommandExpandLists() const;
  void SetCommandExpandLists(bool b);

private:
  cmPropertyMap Properties;
  std::string Name;
  std::vector<std::string> Command;
  bool CommandExpandLists;

  bool OldStyle;

  cmMakefile* Makefile;
  cmListFileBacktrace Backtrace;
};
back to top