mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
install(SBOM) could crash for dependencies outside an export set and mishandle private dependencies expressed through LINK_ONLY. Resolve link expressions before target lookup, traverse unexported dependencies transitively, and isolate document state per configuration. Preserve target license precedence and align document metadata inheritance with CPS. Add regression coverage for these cases. Fixes: #28141 Fixes: #28210
33 lines
944 B
C++
33 lines
944 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 "cmConfigure.h" // IWYU pragma: keep
|
|
|
|
#include <iosfwd>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "cmExportFileGenerator.h"
|
|
#include "cmSbomBuilder.h"
|
|
|
|
class cmExportSet;
|
|
class cmSbomArguments;
|
|
|
|
/** Build-tree SBOM (`export(SBOM ...)`). Covers the targets in the
|
|
* associated export sets. */
|
|
class cmBuildSbomBuilder final : public cmSbomBuilder
|
|
{
|
|
public:
|
|
cmBuildSbomBuilder(cmSbomArguments const& args,
|
|
std::vector<cmExportSet*> const& exportSets);
|
|
|
|
bool Generate(std::ostream& os, std::string const& config) override;
|
|
|
|
protected:
|
|
cmExportFileGenerator::ExportInfo FindExportInfoFor(
|
|
cmGeneratorTarget const* target) const override;
|
|
std::vector<std::string> FindSbomPackagesFor(
|
|
cmGeneratorTarget const* target) const override;
|
|
};
|