MCPcopy Create free account
hub / github.com/Kitware/CMake / DumpToolchain

Method DumpToolchain

Source/cmFileAPIToolchains.cxx:75–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75Json::Value Toolchains::DumpToolchain(std::string const& lang)
76{
77 static std::vector<ToolchainVariable> const CompilerVariables{
78 { "path", "COMPILER", false, false },
79 { "commandFragment", "COMPILER_ARG1", false, true },
80 { "id", "COMPILER_ID", false, false },
81 { "version", "COMPILER_VERSION", false, false },
82 { "target", "COMPILER_TARGET", false, false },
83 };
84
85 static std::vector<ToolchainVariable> const CompilerImplicitVariables{
86 { "includeDirectories", "IMPLICIT_INCLUDE_DIRECTORIES", true, false },
87 { "linkDirectories", "IMPLICIT_LINK_DIRECTORIES", true, false },
88 { "linkFrameworkDirectories", "IMPLICIT_LINK_FRAMEWORK_DIRECTORIES", true,
89 false },
90 { "linkLibraries", "IMPLICIT_LINK_LIBRARIES", true, false },
91 };
92
93 static ToolchainVariable const SourceFileExtensionsVariable{
94 "sourceFileExtensions", "SOURCE_FILE_EXTENSIONS", true, false
95 };
96
97 auto const& mf =
98 this->FileAPI.GetCMakeInstance()->GetGlobalGenerator()->GetMakefiles()[0];
99 Json::Value toolchain = Json::objectValue;
100 toolchain["language"] = lang;
101 toolchain["compiler"] =
102 this->DumpToolchainVariables(mf.get(), lang, CompilerVariables);
103 toolchain["compiler"]["implicit"] =
104 this->DumpToolchainVariables(mf.get(), lang, CompilerImplicitVariables);
105 this->DumpToolchainVariable(mf.get(), toolchain, lang,
106 SourceFileExtensionsVariable);
107 return toolchain;
108}
109
110Json::Value Toolchains::DumpToolchainVariables(
111 cmMakefile const* mf, std::string const& lang,

Callers 1

DumpToolchainsMethod · 0.95

Calls 5

DumpToolchainVariableMethod · 0.95
GetGlobalGeneratorMethod · 0.45
GetCMakeInstanceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected