mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
Add a new signature to help populate INTERFACE_LINK_LIBRARIES and LINK_LIBRARIES cleanly in a single call. Add policy CMP0023 to control whether the keyword signatures can be mixed with uses of the plain signatures on the same target.
This commit is contained in:
@@ -113,6 +113,16 @@ public:
|
||||
"directory of the framework will also be processed as a \"usage "
|
||||
"requirement\". This has the same effect as passing the framework "
|
||||
"directory as an include directory."
|
||||
" target_link_libraries(<target>\n"
|
||||
" <PRIVATE|PUBLIC|INTERFACE> <lib> ...\n"
|
||||
" [<PRIVATE|PUBLIC|INTERFACE> <lib> ... ] ...])\n"
|
||||
"The PUBLIC, PRIVATE and INTERFACE keywords can be used to specify "
|
||||
"both the link dependencies and the link interface in one command. "
|
||||
"Libraries and targets following PUBLIC are linked to, and are "
|
||||
"made part of the link interface. Libraries and targets "
|
||||
"following PRIVATE are linked to, but are not made part of the "
|
||||
"link interface. Libraries following INTERFACE are appended "
|
||||
"to the link interface and are not used for linking <target>."
|
||||
"\n"
|
||||
" target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
|
||||
" [[debug|optimized|general] <lib>] ...)\n"
|
||||
@@ -120,7 +130,8 @@ public:
|
||||
"to the INTERFACE_LINK_LIBRARIES target property instead of using them "
|
||||
"for linking. If policy CMP0022 is not NEW, then this mode also "
|
||||
"appends libraries to the LINK_INTERFACE_LIBRARIES and its "
|
||||
"per-configuration equivalent. "
|
||||
"per-configuration equivalent. This signature "
|
||||
"is for compatibility only. Prefer the INTERFACE mode instead. "
|
||||
"Libraries specified as \"debug\" are wrapped in a generator "
|
||||
"expression to correspond to debug builds. If policy CMP0022 is not "
|
||||
"NEW, the libraries are also appended to the "
|
||||
@@ -139,7 +150,9 @@ public:
|
||||
" [<LINK_PRIVATE|LINK_PUBLIC>\n"
|
||||
" [[debug|optimized|general] <lib>] ...])\n"
|
||||
"The LINK_PUBLIC and LINK_PRIVATE modes can be used to specify both "
|
||||
"the link dependencies and the link interface in one command. "
|
||||
"the link dependencies and the link interface in one command. This "
|
||||
"signature is for compatibility only. Prefer the PUBLIC or PRIVATE "
|
||||
"keywords instead. "
|
||||
"Libraries and targets following LINK_PUBLIC are linked to, and are "
|
||||
"made part of the INTERFACE_LINK_LIBRARIES. If policy CMP0022 is not "
|
||||
"NEW, they are also made part of the LINK_INTERFACE_LIBRARIES. "
|
||||
@@ -185,14 +198,17 @@ private:
|
||||
cmTarget* Target;
|
||||
enum ProcessingState {
|
||||
ProcessingLinkLibraries,
|
||||
ProcessingLinkInterface,
|
||||
ProcessingPublicInterface,
|
||||
ProcessingPrivateInterface
|
||||
ProcessingPlainLinkInterface,
|
||||
ProcessingKeywordLinkInterface,
|
||||
ProcessingPlainPublicInterface,
|
||||
ProcessingKeywordPublicInterface,
|
||||
ProcessingPlainPrivateInterface,
|
||||
ProcessingKeywordPrivateInterface
|
||||
};
|
||||
|
||||
ProcessingState CurrentProcessingState;
|
||||
|
||||
void HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
|
||||
bool HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user