| 73 | } |
| 74 | |
| 75 | Json::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 | |
| 110 | Json::Value Toolchains::DumpToolchainVariables( |
| 111 | cmMakefile const* mf, std::string const& lang, |
no test coverage detected