exports: support CXX_MODULES_DIRECTORY

This directory will be used to store build-discovered information about
targets such as the modules provided by the files in the relevant
`FILE_SET` types.

A directory is used because basing the name on a `<FILE_NAME>-*.cmake`
pattern makes it end up being globbed in the configuration-dependent
information mechanism. Since old modules and targets may be around,
unconditionally including them may refer to targets that do not actually
exist.
This commit is contained in:
Ben Boeckel
2022-04-18 12:26:49 -04:00
parent 29118091dc
commit fe44cbe9e7
7 changed files with 70 additions and 9 deletions

View File

@@ -47,6 +47,16 @@ public:
}
void SetExportSet(cmExportSet*);
/** Set the name of the C++ module directory. */
void SetCxxModuleDirectory(std::string cxx_module_dir)
{
this->CxxModulesDirectory = std::move(cxx_module_dir);
}
const std::string& GetCxxModuleDirectory() const
{
return this->CxxModulesDirectory;
}
/** Set whether to append generated code to the output file. */
void SetAppendMode(bool append) { this->AppendMode = append; }
@@ -88,4 +98,6 @@ protected:
cmExportSet* ExportSet;
std::vector<cmGeneratorTarget*> Exports;
cmLocalGenerator* LG;
// The directory for C++ module information.
std::string CxxModulesDirectory;
};