Write object files in many different formats-for example, COFF or "a.out". This version of ld uses the general purpose BFD libraries to operate on object files. This man page does not describe the command language see the ld entry in "info" for full details on the command language and on other Ld accepts Linker Command Language files written in a superset of AT&T 's Link Editor Command Language syntax, to provide explicitĪnd total control over the linking process. Usually the last step in compiling a program is It uses the -weak_library or -weak-l option as appropriate,Īnd has the same linker constraints as WEAK_FRAMEWORK.Ld combines a number of object and archive files, relocates their data and ties up symbol references. This is similar to the WEAK_FRAMEWORK feature, except it is for use It uses the -reexport_library or -reexport-l option as appropriate,Īnd has the same linker constraints as REEXPORT_FRAMEWORK. This is similar to the REEXPORT_FRAMEWORK feature, except it is for use It uses the -needed_library or -needed-l option as appropriate,Īnd has the same linker constraints as NEEDED_FRAMEWORK. With non-framework targets or libraries (Apple platforms only). This is similar to the NEEDED_FRAMEWORK feature, except it is for use The -weak_framework option and has the same linker constraints as To mark the framework and all references to it as weak imports. ![]() It uses the -reexport_framework option and has the ![]() That the framework should be available to clients linking to the libraryīeing created. This is similar to the FRAMEWORK feature, except it tells the linker The -needed_framework option and has the same linker constraints as To link with the framework even if no symbols are used from it. This is similar to the FRAMEWORK feature, except it forces the linker Well as the suffix of the framework library name are now supported by New in version 3.25: The FRAMEWORK_MULTI_CONFIG_POSTFIX_ target property as For a file path, if itĬontains a directory part, that directory will be added as a framework If a target is given, that target must have theįRAMEWORK target property set to true. The framework can be specified as a CMake framework target, a bare framework Provided with Xcode, or one compatible with it). It can only be used on Apple platforms,Īnd only with a linker that understands the option used (i.e. This option tells the linker to search for the specified framework using When using a MSVC or MSVC-like toolchain, the MSVC version must Due to a limitation of the Apple linker, itĬannot be specified as a plain library name like foo, where foo The library must be specified as a CMake target name,Ī library file name (such as libfoo.a), or a library file path (such as Supported for the following platforms, with limitations as noted:Īll Apple variants. WHOLE_ARCHIVEįorce inclusion of all members of a static library. LINK_LIBRARY_OVERRIDE_ target properties. This feature corresponds to standard linking, essentially equivalent to The following built-in library features are pre-defined by CMake: DEFAULT weak_library /path/to/lib -Xlinker -weak-lexternal. ) if( CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED ) target_link_libraries( main PRIVATE "$" ) else() target_link_libraries( main PRIVATE lib external ) endif()ĬMake will generate the following linker command line fragment when linking The PATH" ) set( CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED TRUE ) endif() add_library( lib SHARED. (CMake targets and external libraries specified with file paths) and anotherįor other items specified by name only. In addition to the above, it is possible to have one pattern for paths ![]() Or the item itself exactly as specified in the is expanded to how the library would normally be linked on on Windows, or the library base name for other platforms). Or to a platform-specific value based on the item otherwise (the same as is expanded to the full path to the library for CMake targets, The following placeholders can be used in the expression: is used to specify the pattern for constructing theĬorresponding fragment on the linker command line for each library. LINK_GROUP generator expression should be used instead for such This means constructs like -start-group and -end-group,Īs supported by the GNU ld linker, cannot be used in this way. More than once if the library list is reorganized by CMake to satisfy otherĬonstraints. Grouped together though, so the and may appear There is no guarantee that the list of specified libraries will be kept LINK_LIBRARY expression, not each library item individually. Respectively the whole list of libraries specified in the When and are specified, they precede and follow
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |