mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Reorganize CMake's SARIF implementation to clearly distinguish between the SARIF standard and CMake's result reporting structure, fixing several validation failures. - Removed unused message strings in reported rules. - Report artifact locations relative to the CMake home directory. - Use the recommended schema URL. - Stop reporting some invalid locations read from the top of the stack. cmMessenger no longer manages a SARIF log but stores a list of displayed messages. The SARIF log is constructed from displayed messages upon writing the file.
30 lines
693 B
C++
30 lines
693 B
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file LICENSE.rst or https://cmake.org/licensing for details. */
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <cm/optional>
|
|
|
|
class cmake;
|
|
|
|
/// @brief Manages SARIF logging for a CMake run
|
|
///
|
|
/// Writes diagnostics collected during a CMake run to a SARIF log file if
|
|
/// enabled by conditions.
|
|
class cmCMakeSarifLogger final
|
|
{
|
|
public:
|
|
cmCMakeSarifLogger(cmake& cm);
|
|
~cmCMakeSarifLogger();
|
|
|
|
void GenerateForRun() const;
|
|
|
|
private:
|
|
bool WriteFile(std::string const& path,
|
|
bool createParentDirectories = false) const;
|
|
cm::optional<std::string> FileOutputPath() const;
|
|
|
|
cmake const& CM;
|
|
};
|