| 141 | } |
| 142 | |
| 143 | bool cmRuntimeDependencyArchive::Prepare() |
| 144 | { |
| 145 | std::string platform = this->GetMakefile()->GetSafeDefinition( |
| 146 | "CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM"); |
| 147 | if (platform.empty()) { |
| 148 | std::string systemName = |
| 149 | this->GetMakefile()->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME"); |
| 150 | if (systemName == "Windows") { |
| 151 | platform = "windows+pe"; |
| 152 | } else if (systemName == "Darwin") { |
| 153 | platform = "macos+macho"; |
| 154 | } else if (systemName == "Linux") { |
| 155 | platform = "linux+elf"; |
| 156 | } |
| 157 | } |
| 158 | if (platform == "linux+elf") { |
| 159 | this->Linker = cm::make_unique<cmBinUtilsLinuxELFLinker>(this); |
| 160 | } else if (platform == "windows+pe") { |
| 161 | this->Linker = cm::make_unique<cmBinUtilsWindowsPELinker>(this); |
| 162 | } else if (platform == "macos+macho") { |
| 163 | this->Linker = cm::make_unique<cmBinUtilsMacOSMachOLinker>(this); |
| 164 | } else { |
| 165 | std::ostringstream e; |
| 166 | e << "Invalid value for CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: " |
| 167 | << platform; |
| 168 | this->SetError(e.str()); |
| 169 | return false; |
| 170 | } |
| 171 | |
| 172 | return this->Linker->Prepare(); |
| 173 | } |
| 174 | |
| 175 | bool cmRuntimeDependencyArchive::GetRuntimeDependencies( |
| 176 | std::vector<std::string> const& executables, |
nothing calls this directly
no test coverage detected