| 796 | } |
| 797 | |
| 798 | void cmFastbuildNormalTargetGenerator::ComputePaths( |
| 799 | FastbuildTarget& target) const |
| 800 | { |
| 801 | std::string const objPath = GetGeneratorTarget()->GetSupportDirectory(); |
| 802 | EnsureDirectoryExists(objPath); |
| 803 | target.Variables["TargetOutDir"] = |
| 804 | cmSystemTools::ConvertToOutputPath(this->ConvertToFastbuildPath(objPath)); |
| 805 | |
| 806 | if (GeneratorTarget->GetType() <= cmStateEnums::MODULE_LIBRARY) { |
| 807 | std::string const pdbDir = GeneratorTarget->GetPDBDirectory(Config); |
| 808 | LogMessage("GetPDBDirectory: " + pdbDir); |
| 809 | EnsureDirectoryExists(pdbDir); |
| 810 | std::string const linkerPDB = |
| 811 | cmStrCat(pdbDir, '/', this->GeneratorTarget->GetPDBName(Config)); |
| 812 | |
| 813 | if (!linkerPDB.empty()) { |
| 814 | target.Variables["LinkerPDB"] = cmSystemTools::ConvertToOutputPath( |
| 815 | this->ConvertToFastbuildPath(linkerPDB)); |
| 816 | } |
| 817 | } |
| 818 | std::string const compilerPDB = this->ComputeTargetCompilePDB(this->Config); |
| 819 | if (!compilerPDB.empty()) { |
| 820 | LogMessage("ComputeTargetCompilePDB: " + compilerPDB); |
| 821 | std::string compilerPDBArg = cmSystemTools::ConvertToOutputPath( |
| 822 | this->ConvertToFastbuildPath(compilerPDB)); |
| 823 | if (cmHasSuffix(compilerPDB, '/')) { |
| 824 | // The compiler will choose the .pdb file name. |
| 825 | this->EnsureDirectoryExists(compilerPDB); |
| 826 | // ConvertToFastbuildPath dropped the trailing slash. Add it back. |
| 827 | // We do this after ConvertToOutputPath so that we can use a forward |
| 828 | // slash in the case that the argument is quoted. |
| 829 | if (cmHasSuffix(compilerPDBArg, '"')) { |
| 830 | // A quoted trailing backslash requires escaping, e.g., `/Fd"dir\\"`, |
| 831 | // but fbuild does not parse such arguments correctly as of 1.15. |
| 832 | // Always use a forward slash. |
| 833 | compilerPDBArg.insert(compilerPDBArg.size() - 1, 1, '/'); |
| 834 | } else { |
| 835 | // An unquoted trailing slash or backslash is fine. |
| 836 | compilerPDBArg.push_back(kPATH_SLASH); |
| 837 | } |
| 838 | } else { |
| 839 | // We have an explicit .pdb path with file name. |
| 840 | this->EnsureParentDirectoryExists(compilerPDB); |
| 841 | } |
| 842 | target.Variables["CompilerPDB"] = std::move(compilerPDBArg); |
| 843 | } |
| 844 | std::string const impLibFullPath = |
| 845 | GeneratorTarget->GetFullPath(Config, cmStateEnums::ImportLibraryArtifact); |
| 846 | std::string impLibFile = ConvertToFastbuildPath(impLibFullPath); |
| 847 | cmSystemTools::MakeDirectory(cmSystemTools::GetFilenamePath(impLibFullPath)); |
| 848 | if (!impLibFile.empty()) { |
| 849 | cmSystemTools::ConvertToOutputSlashes(impLibFile); |
| 850 | target.Variables["TargetOutputImplib"] = std::move(impLibFile); |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | void cmFastbuildNormalTargetGenerator::Generate() |
| 855 | { |
nothing calls this directly
no test coverage detected