LINKER_TYPEΒΆ
New in version 3.29.
Specify which linker will be used for the link step. The property value may use
generator expressions.
add_library(lib1 SHARED ...)
set_property(TARGET lib1 PROPERTY LINKER_TYPE LLD)
This specifies that lib1 should use linker type LLD for the link step.
The implementation details will be provided by the variable
CMAKE_<LANG>_USING_LINKER_<TYPE> with <TYPE> having the value
LLD.
This property is not supported on Green Hills MULTI and
Visual Studio 9 2008 generators.
Note
It is assumed that the linker specified is fully compatible with the standard one. CMake will not do any options translation.
Linker types are case-sensitive and may only contain letters, numbers and underscores. Linker types defined in all uppercase are reserved for CMake's own built-in types. The pre-defined linker types are:
DEFAULTThis type corresponds to standard linking, essentially equivalent to not specifying
LINKER_TYPEtarget property.SYSTEMUse the standard linker delivered by the platform or the standard toolkit (for example,
SYSTEMimply Microsoft linker for allMSVCcompatible compilers). This type is supported for the following platforms/compilers:Linux, for
GNU,Clang,LLVMFlangandNVIDIAcompilers.All Apple variants for
AppleClang,ClangandGNUcompilers.Windows, for
MSVC,GNU,ClangandNVIDIAcompilers.
LLDUse the
LLVMlinker. This type is supported for the following platforms/compilers:Linux, for
GNU,Clang,LLVMFlangandNVIDIAcompilers.All Apple variants for
ClangandAppleClangcompilers.Windows, for
GNU,Clangcompilers withGNUfront-end andCLang,MSVCandNVIDIAcompilers withMSVCfront-end.
BFDUse the
GNUlinker. This type is supported for the following platforms/compilers:Linux, for
GNU,Clang,LLVMFlangandNVIDIAcompilers.Windows, for
GNU,Clangcompilers withGNUfront-end.
GOLDSupported on Linux platform for
GNU,Clang,LLVMFlangandNVIDIAcompilers.MOLDUse the mold linker. This type is supported on the following platforms:
Linux platform for
GNU,Clang,LLVMFlangandNVIDIAcompilers.All Apple variants for
ClangandAppleClangcompilers as an alias toSOLD.
SOLDUse the sold linker. This type is only supported on Apple platforms for
ClangandAppleClangcompilers.APPLE_CLASSICUse the Apple linker in the classic behavior (i.e. before
Xcode 15.0). This type is only supported on Apple platforms forGNU,ClangandAppleClangcompilers.MSVCUse the Microsoft linker. This type is only supported on Windows platform for
MSVCandClangcompiler withMSVCfront-end.