| 1264 | } |
| 1265 | |
| 1266 | void cmGlobalFastbuildGenerator::WriteLinker( |
| 1267 | FastbuildLinkerNode const& LinkerNode, bool allowDistribution) |
| 1268 | { |
| 1269 | WriteCommand( |
| 1270 | LinkerNode.Type == FastbuildLinkerNode::EXECUTABLE ? "Executable" |
| 1271 | : LinkerNode.Type == FastbuildLinkerNode::SHARED_LIBRARY ? "DLL" |
| 1272 | : "Library", |
| 1273 | (!LinkerNode.Name.empty() && LinkerNode.Name != LinkerNode.LinkerOutput) |
| 1274 | ? Quote(LinkerNode.Name) |
| 1275 | : "", |
| 1276 | 1); |
| 1277 | Indent(1); |
| 1278 | *BuildFileStream << "{\n"; |
| 1279 | { |
| 1280 | if (!LinkerNode.PreBuildDependencies.empty()) { |
| 1281 | WriteArray("PreBuildDependencies", Wrap(LinkerNode.PreBuildDependencies), |
| 1282 | 2); |
| 1283 | } |
| 1284 | if (!allowDistribution) { |
| 1285 | WriteVariable("AllowDistribution", "false", 2); |
| 1286 | } |
| 1287 | |
| 1288 | if (!LinkerNode.Compiler.empty() && |
| 1289 | LinkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY) { |
| 1290 | WriteVariable("Compiler", LinkerNode.Compiler, 2); |
| 1291 | WriteVariable("CompilerOptions", Quote(LinkerNode.CompilerOptions), 2); |
| 1292 | WriteVariable("CompilerOutputPath", Quote("."), 2); |
| 1293 | } |
| 1294 | if (!LocalEnvironment.empty()) { |
| 1295 | WriteVariable("Environment", "." FASTBUILD_ENV_VAR_NAME, 2); |
| 1296 | } |
| 1297 | |
| 1298 | WriteVariable(LinkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY |
| 1299 | ? "Librarian" |
| 1300 | : "Linker", |
| 1301 | Quote(LinkerNode.Linker), 2); |
| 1302 | |
| 1303 | WriteVariable(LinkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY |
| 1304 | ? "LibrarianOptions" |
| 1305 | : "LinkerOptions", |
| 1306 | Quote(LinkerNode.LinkerOptions), 2); |
| 1307 | |
| 1308 | WriteVariable(LinkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY |
| 1309 | ? "LibrarianOutput" |
| 1310 | : "LinkerOutput", |
| 1311 | Quote(LinkerNode.LinkerOutput), 2); |
| 1312 | |
| 1313 | if (!LinkerNode.LibrarianAdditionalInputs.empty()) { |
| 1314 | WriteArray(LinkerNode.Type == FastbuildLinkerNode::STATIC_LIBRARY |
| 1315 | ? "LibrarianAdditionalInputs" |
| 1316 | : "Libraries", |
| 1317 | Wrap(LinkerNode.LibrarianAdditionalInputs), 2); |
| 1318 | } |
| 1319 | if (!LinkerNode.Libraries2.empty()) { |
| 1320 | WriteArray("Libraries2", Wrap(LinkerNode.Libraries2), 2); |
| 1321 | } |
| 1322 | if (!LinkerNode.LibrarianAdditionalInputs.empty()) { |
| 1323 | |