mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
cmGeneratorExpressionNode: implement COMPILE_ONLY genex
This generator expression is the inverse of `LINK_ONLY` and only coveys usage requirements for the purposes of compilation. Its intended use is to avoid needing to export targets that do not have link usage requirements (e.g., header-only libraries) when used by another target. It will also be used to represent private usage requirements on exported C++ module-containing targets in the future. Eventually there should be logic to collapse nesting of `$<COMPILE_ONLY>` and `$<LINK_ONLY>` when generating instances of either. A TODO is left in the code for this case. See: #15415
This commit is contained in:
committed by
Robert Maynard
parent
6c11f7e4a8
commit
0fb923c460
@@ -552,6 +552,7 @@ bool TLL::HandleLibrary(ProcessingState currentProcessingState,
|
||||
currentProcessingState == ProcessingPlainPrivateInterface) {
|
||||
if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
|
||||
this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
||||
// TODO: Detect and no-op `$<COMPILE_ONLY>` genexes here.
|
||||
std::string configLib =
|
||||
this->Target->GetDebugGeneratorExpressions(lib, llt);
|
||||
if (cmGeneratorExpression::IsValidTargetName(lib) ||
|
||||
|
||||
Reference in New Issue
Block a user