mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 19:43:23 +08:00
cmCxxModuleUsageEffects: add a class to capture module usage effects
When importing a C++ module, there may be requirements imposed by the importer so that the compiler can reliably read the BMI. For example, the standard used in the importer may need to also apply to the imported BMI. Right now, there are no tracked requirements. As we learn more, this class can start tracking more information. See: https://wg21.link/p2581r2
This commit is contained in:
@@ -170,6 +170,8 @@ add_library(
|
||||
cmCustomCommandTypes.h
|
||||
cmCxxModuleMapper.cxx
|
||||
cmCxxModuleMapper.h
|
||||
cmCxxModuleUsageEffects.cxx
|
||||
cmCxxModuleUsageEffects.h
|
||||
cmDefinitions.cxx
|
||||
cmDefinitions.h
|
||||
cmDependencyProvider.h
|
||||
|
21
Source/cmCxxModuleUsageEffects.cxx
Normal file
21
Source/cmCxxModuleUsageEffects.cxx
Normal file
@@ -0,0 +1,21 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmCxxModuleUsageEffects.h"
|
||||
|
||||
cmCxxModuleUsageEffects::cmCxxModuleUsageEffects(
|
||||
cmGeneratorTarget const* /*gt*/)
|
||||
: Hash("0000000000000000000000000000000000000000")
|
||||
{
|
||||
// TODO: collect information from the generator target as to what might
|
||||
// affect module consumption.
|
||||
}
|
||||
|
||||
void cmCxxModuleUsageEffects::ApplyToTarget(cmTarget* /*tgt*/)
|
||||
{
|
||||
// TODO: apply the information collected in the constructor
|
||||
}
|
||||
|
||||
std::string const& cmCxxModuleUsageEffects::GetHash() const
|
||||
{
|
||||
return this->Hash;
|
||||
}
|
22
Source/cmCxxModuleUsageEffects.h
Normal file
22
Source/cmCxxModuleUsageEffects.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* 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>
|
||||
|
||||
class cmGeneratorTarget;
|
||||
class cmTarget;
|
||||
|
||||
class cmCxxModuleUsageEffects
|
||||
{
|
||||
public:
|
||||
cmCxxModuleUsageEffects(cmGeneratorTarget const* gt);
|
||||
|
||||
void ApplyToTarget(cmTarget* tgt);
|
||||
std::string const& GetHash() const;
|
||||
|
||||
private:
|
||||
std::string Hash;
|
||||
};
|
Reference in New Issue
Block a user