Files
cmake/Source/cmCMakeSarifLogger.h
T
Daniel Tierney 4cc948ad08 cmSarif: Improve conformance with SARIF in CMake result reporting
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.
2026-06-29 14:12:31 -04:00

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;
};