saker.msvc Documentation TaskDoc JavaDoc Packages
Links input files using the Microsoft Visual C++ toolchain. The task provides access to the MSVC linker (link.exe). It can be used to link appropriate input files into a final binary. Generally it is used to link the output object files from the saker.msvc.ccompile() task, however, other type of files which are valid inputs to the backend linker are accepted as well. The task supports distributing its workload using build clusters.
Summary
Parameters
ArchitectureSpecifies the linking target Architecture.
BinaryNameSpecifies the file name of the link product without the extension.
GenerateWinmdSets if Windows Metadata (.winmd) should be generated as part of the linking process.
IdentifierThe Identifier of the link operation.
Input
Required parameter.
Specifies one or more inputs for the link operation.
LibraryPathSpecifies the library path that will be searched for libraries.
LinkerOptionsSpecifies one or more option specifications that are merged with the inputs when applicable.
SDKsSpecifies the SDKs (Software Development Kits) used by the task.
SimpleParametersSpecifies one or more arguments that should be directly passed to the linker backend (link.exe).
Parameters
Specifies the linking target Architecture. The link operation will target the specified architecture. If no architecture is specified, the task will attempt to infer it from the input objects. It will check if any of the input is an output of the saker.msvc.ccompile() task, and if so the target architecture will be set to the architecture that was used during compilation. If the target architecture is incompatible with the input files, then the linker backed (link.exe) will most likely emit an error or warning to signal that. The used Architecture will be taken into account as a qualifier when merging LinkerOptions.
Specifies the file name of the link product without the extension. The specified string will be used as the name part of the generated executable or library. The extension is determined automatically. If not specified, the file name will be generated based on the compilation Identifier.
Sets if Windows Metadata (.winmd) should be generated as part of the linking process. If set to true, this option causes the /WINMD flag to be passed for the linker. Windows Metadata file will be generated alongside the output product. Setting the option to false will cause /WINMD:NO flag to be passed to the linker.
The Identifier of the link operation. Each link task has an identifier that uniquely identifies it during a build execution. The identifier is used to determine the output directory of the link operation. It is also used to merge the appropriate options specified in LinkerOptions parameter. An identifier constists of dash separated parts of character sequences of a-z, A-Z, 0-9, _, ., (), [], @. An option specification in the LinkerOptions can be merged if the linker identifier contains all parts of the option Identifier. If not specified, the identifier is determined based on the current working directory, or assigned to "default", however, it won't be subject to option merging.
Required parameter.
Specifies one or more inputs for the link operation. The inputs may be either simple paths, wildcards, file locations, file collections or task output from saker.msvc.ccompile().
Specifies the library path that will be searched for libraries. The values may be simple paths, wildcards, file locations, file collections, or SDK paths. The link task doesn't specify any library paths by default. Corresponds to the /LIBPATH command line option for link.exe.
Specifies one or more option specifications that are merged with the inputs when applicable. The parameter can be used to indirectly specify various linker arguments independent of the actual inputs. This is generally useful when common options need to be specified to multiple link operation inputs. When linker arguments are determined, each option specification will be merged into the used argumnets if applicable. An option is considered to be applicable to merging if all of the Identifier parts are contained in the link task Identifier, and the Architecture arguments can be matched. In case of unresolveable merge conflicts, the task will throw an appropriate exception. Output from the saker.msvc.coptions.preset() task can be passed as a value to this parameter.
Specifies the SDKs (Software Development Kits) used by the task. SDKs represent development kits that are available in the build environment and to the task. SDKs are used to determine the appropriate build environment to execute the task, as well to resolve paths against them (e.g. IncludeDirectory, LibraryPath). The "MSVC" SDK is used to determine the location of the backend executables (cl.exe, link.exe). If it is not specified, then the task will attempt to determine it automatically.
Specifies one or more arguments that should be directly passed to the linker backend (link.exe). Any arguments specified will be appended to the link.exe invocation for the inputs. Take care when using this option as specifying files here may result in incorrect incremental builds. The order of the specified arguments are kept.