cmake/Source/cmRulePlaceholderExpander.h

94 lines
3.0 KiB
C
Raw Normal View History

2017-04-14 19:02:05 +02:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2017-04-14 19:02:05 +02:00
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2017-04-14 19:02:05 +02:00
#include <map>
#include <string>
2022-08-04 22:12:04 +02:00
#include "cmPlaceholderExpander.h"
2017-04-14 19:02:05 +02:00
class cmOutputConverter;
2022-08-04 22:12:04 +02:00
class cmRulePlaceholderExpander : public cmPlaceholderExpander
2017-04-14 19:02:05 +02:00
{
public:
cmRulePlaceholderExpander(
2019-11-11 23:01:05 +01:00
std::map<std::string, std::string> compilers,
std::map<std::string, std::string> variableMappings,
std::string compilerSysroot, std::string linkerSysroot);
2017-04-14 19:02:05 +02:00
void SetTargetImpLib(std::string const& targetImpLib)
{
this->TargetImpLib = targetImpLib;
}
2018-08-09 18:06:22 +02:00
// Create a struct to hold the variables passed into
2017-04-14 19:02:05 +02:00
// ExpandRuleVariables
struct RuleVariables
{
2021-09-14 00:13:48 +02:00
const char* CMTargetName = nullptr;
const char* CMTargetType = nullptr;
const char* TargetPDB = nullptr;
const char* TargetCompilePDB = nullptr;
const char* TargetVersionMajor = nullptr;
const char* TargetVersionMinor = nullptr;
const char* Language = nullptr;
const char* AIXExports = nullptr;
const char* Objects = nullptr;
const char* Target = nullptr;
const char* LinkLibraries = nullptr;
const char* Source = nullptr;
const char* AssemblySource = nullptr;
const char* PreprocessedSource = nullptr;
const char* DynDepFile = nullptr;
const char* Output = nullptr;
const char* Object = nullptr;
const char* ObjectDir = nullptr;
const char* ObjectFileDir = nullptr;
const char* Flags = nullptr;
const char* ObjectsQuoted = nullptr;
const char* SONameFlag = nullptr;
const char* TargetSOName = nullptr;
const char* TargetInstallNameDir = nullptr;
const char* LinkFlags = nullptr;
const char* Manifests = nullptr;
const char* LanguageCompileFlags = nullptr;
const char* Defines = nullptr;
const char* Includes = nullptr;
const char* DependencyFile = nullptr;
const char* DependencyTarget = nullptr;
const char* FilterPrefix = nullptr;
const char* SwiftLibraryName = nullptr;
const char* SwiftModule = nullptr;
const char* SwiftModuleName = nullptr;
2023-05-23 16:38:00 +02:00
const char* SwiftOutputFileMapOption = nullptr;
2021-09-14 00:13:48 +02:00
const char* SwiftSources = nullptr;
const char* ISPCHeader = nullptr;
2022-03-29 21:10:50 +02:00
const char* CudaCompileMode = nullptr;
2021-09-14 00:13:48 +02:00
const char* Fatbinary = nullptr;
const char* RegisterFile = nullptr;
const char* Launcher = nullptr;
2017-04-14 19:02:05 +02:00
};
// Expand rule variables in CMake of the type found in language rules
void ExpandRuleVariables(cmOutputConverter* outputConverter,
std::string& string,
const RuleVariables& replaceValues);
private:
2022-08-04 22:12:04 +02:00
std::string ExpandVariable(std::string const& variable) override;
2017-04-14 19:02:05 +02:00
std::string TargetImpLib;
std::map<std::string, std::string> Compilers;
std::map<std::string, std::string> VariableMappings;
std::string CompilerSysroot;
2017-07-20 19:35:53 +02:00
std::string LinkerSysroot;
2022-08-04 22:12:04 +02:00
cmOutputConverter* OutputConverter = nullptr;
RuleVariables const* ReplaceValues = nullptr;
2017-04-14 19:02:05 +02:00
};