瀏覽代碼

Merge topic 'fileapi-direct-dependencies'

f38f325e08 fileAPI: Add direct dependencies to target codemodel files
004d825f3e fileAPI: Add test coverage for interface direct and genex contexts
53ed1e5893 fileAPI: Fix wrong linking relationship in symbolic library test
1b764b6816 cmLinkItem: Remove redundant cmLinkImplItem class

Acked-by: Kitware Robot <[email protected]>
Tested-by: buildbot <[email protected]>
Acked-by: Martin Duffy <[email protected]>
Acked-by: Alex Overchenko <[email protected]>
Merge-request: !11219
Brad King 1 周之前
父節點
當前提交
cffa80c48d
共有 100 個文件被更改,包括 3744 次插入180 次删除
  1. 223 3
      Help/manual/cmake-file-api.7.rst
  2. 140 0
      Help/manual/file_api/schema_target.json
  3. 5 0
      Help/release/dev/fileapi-direct-dependencies.rst
  4. 1 1
      Source/cmComputeTargetDepends.cxx
  5. 5 5
      Source/cmEvaluatedTargetProperty.cxx
  6. 3 4
      Source/cmEvaluatedTargetProperty.h
  7. 145 0
      Source/cmFileAPICodemodel.cxx
  8. 1 1
      Source/cmGeneratorExpressionNode.cxx
  9. 2 2
      Source/cmGeneratorTarget.cxx
  10. 8 5
      Source/cmGeneratorTarget.h
  11. 3 3
      Source/cmGeneratorTarget_IncludeDirectories.cxx
  12. 20 44
      Source/cmGeneratorTarget_Link.cxx
  13. 1 1
      Source/cmGeneratorTarget_LinkDirectories.cxx
  14. 2 2
      Source/cmGeneratorTarget_Sources.cxx
  15. 7 7
      Source/cmGeneratorTarget_TargetPropertyEntry.cxx
  16. 5 5
      Source/cmGlobalXCodeGenerator.cxx
  17. 0 5
      Source/cmLinkItem.cxx
  18. 5 9
      Source/cmLinkItem.h
  19. 4 3
      Source/cmLinkItemGraphVisitor.cxx
  20. 1 1
      Source/cmLinkLineDeviceComputer.cxx
  21. 155 3
      Tests/RunCMake/FileAPI/codemodel-v2-check.py
  22. 23 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/directories/direct.json
  23. 15 14
      Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
  24. 2 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
  25. 21 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/projects/direct.json
  26. 15 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json
  27. 11 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json
  28. 55 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
  29. 137 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_direct.json
  30. 11 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json
  31. 19 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json
  32. 31 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json
  33. 11 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json
  34. 23 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json
  35. 215 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
  36. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json
  37. 69 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
  38. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json
  39. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json
  40. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json
  41. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json
  42. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json
  43. 70 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
  44. 10 4
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
  45. 70 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
  46. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
  47. 66 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json
  48. 127 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/compile_usage_exe.json
  49. 24 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json
  50. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
  51. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json
  52. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
  53. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json
  54. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json
  55. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json
  56. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json
  57. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json
  58. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json
  59. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json
  60. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
  61. 10 4
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
  62. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
  63. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
  64. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
  65. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
  66. 120 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json
  67. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json
  68. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_none.json
  69. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json
  70. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_symbolic.json
  71. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/import_framework.json
  72. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_exe.json
  73. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_lib.json
  74. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_symbolic_lib.json
  75. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_lib.json
  76. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_object_lib.json
  77. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_shared_lib.json
  78. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_static_lib.json
  79. 45 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/inject_direct_lib.json
  80. 100 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/inject_direct_lib_impl.json
  81. 94 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json
  82. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_lib.json
  83. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json
  84. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json
  85. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_symbolic_exe.json
  86. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json
  87. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json
  88. 46 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json
  89. 245 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_transitive_direct_exe.json
  90. 145 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_usage_exe.json
  91. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json
  92. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json
  93. 196 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/transitive_direct_lib.json
  94. 102 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/usage_lib.json
  95. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json
  96. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json
  97. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json
  98. 83 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_direct.json
  99. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json
  100. 7 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json

+ 223 - 3
Help/manual/cmake-file-api.7.rst

@@ -1337,9 +1337,19 @@ with members:
 
 ``dependencies``
   Optional member that is present when the target depends on other targets.
-  It is not present if the target is not part of the build system (i.e. it is
-  not an imported target or an interface library with no generated sources).
-  The value is a JSON array of entries corresponding to the dependencies.
+  It is only present if the target is part of the build system.
+  Imported targets are not part of the build system.  Interface libraries
+  are only part of the build system if they have sources or file sets.
+
+  The value is a JSON array of entries corresponding to the build dependencies.
+  The array includes not just direct dependencies, but also transitive
+  dependencies.  All listed targets will build before this one.
+
+  The list of dependencies reflects the *build graph* dependencies, not
+  necessarily the link dependencies.  If there are cycles in the link
+  dependencies of static libraries, not all link dependencies will be
+  reflected in this list of build graph dependencies.
+
   Each entry is a JSON object with members:
 
   ``id``
@@ -1353,6 +1363,216 @@ with members:
     available.  The value is an unsigned integer 0-based index into
     the ``backtraceGraph`` member's ``nodes`` array.
 
+``linkLibraries``
+  Optional member that may be present when the target links directly to one or
+  more other targets or libraries.  It contains items that are used when
+  linking this target.  These come from the target's
+  :prop_tgt:`LINK_LIBRARIES` property (evaluated non-transitively), or the
+  :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` property of another target it
+  links to directly or transitively.
+
+  Items that are only applied as usage requirements (such as being wrapped in a
+  :genex:`$<COMPILE_ONLY:...>` expression) will not be present in this member.
+
+  The value is a JSON array of entries.  Each entry is a JSON object with
+  members:
+
+  ``id``
+    Optional member that is present when the library to be linked is a target.
+    It uniquely identifies the target on which this one has a direct link
+    relationship.  This matches the main ``id`` member of that other target.
+
+    The target this ``id`` identifies is not necessarily part of the build
+    system.  It may be an imported target or an interface library with no
+    sources or file sets.
+
+    Exactly one of ``id`` or ``fragment`` will always be present.
+
+  ``fragment``
+    Optional member that is present when the library to be linked is not a
+    target.  It is a string containing the raw linker command line arguments
+    that capture the relationship.  These will typically be linking to
+    libraries or frameworks by name rather than as a target.
+
+    Exactly one of ``id`` or ``fragment`` will always be present.
+
+  ``backtrace``
+    Optional member that is present when a CMake language backtrace to
+    the command invocation that created this relationship is available.
+    The value is an unsigned integer 0-based index into the
+    ``backtraceGraph`` member's ``nodes`` array.
+
+  ``fromDependency``
+    Optional member that is only present when the relationship is the result of
+    an :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` target property on one of
+    this target's directly or transitively linked libraries.  It is a JSON
+    object with one member:
+
+    ``id``
+      A string uniquely identifying the target whose
+      :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` property created the
+      relationship.  The value matches the main ``id`` member of that target.
+
+  This field was added in codemodel version 2.9.
+
+``interfaceLinkLibraries``
+  Optional member that may be present when the target has one or more interface
+  link libraries.  It contains items that are used when linking consumers of
+  this target.  These come from the target's
+  :prop_tgt:`INTERFACE_LINK_LIBRARIES` property.
+
+  Items that are only applied as usage requirements (such as being wrapped in a
+  :genex:`$<COMPILE_ONLY:...>` expression) will not be present in this member.
+
+  The value is a JSON array of entries.  Each entry is a JSON object with
+  members:
+
+  ``id``
+    Optional member that is present when the interface link library is for a
+    target.  It uniquely identifies that target, with the value matching the
+    main ``id`` member of that target.
+
+    The target this ``id`` identifies is not necessarily part of the build
+    system.  It may be an imported target or an interface library with no
+    sources or file sets.
+
+    Exactly one of ``id`` or ``fragment`` will always be present.
+
+  ``fragment``
+    Optional member that is present when the interface link library is not for
+    a target.  It is a string containing the raw linker command line arguments
+    to be applied to consumers of this target's interface link libraries.
+    These will typically be linker arguments for linking to libraries or
+    frameworks by name rather than as a target.
+
+    Exactly one of ``id`` or ``fragment`` will always be present.
+
+  ``backtrace``
+    Optional member that is present when a CMake language backtrace to the
+    command invocation that created this interface relationship is available.
+    The value is an unsigned integer 0-based index into the
+    ``backtraceGraph`` member's ``nodes`` array.
+
+  This field was added in codemodel version 2.9.
+
+``compileDependencies``
+  Optional member that may be present when the target links directly to one or
+  more other targets that may provide usage requirements to this one.  They
+  affect how this target's sources are compiled.  These relationships are
+  defined by the target's :prop_tgt:`LINK_LIBRARIES` property (evaluated
+  non-transitively) and the :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT`
+  property of other targets it links to directly or transitively.
+
+  Relationships that only apply linking requirements (such as being wrapped
+  in a :genex:`$<LINK_ONLY:...>` expression) will not be present in this
+  member.
+
+  The value is a JSON array of entries.  Each entry is a JSON object with
+  members:
+
+  ``id``
+    A string uniquely identifying the target on which this target directly
+    depends.  This matches the main ``id`` member of the other target.
+
+    The target this ``id`` identifies is not necessarily part of the build
+    system.  It may be an imported target or an interface library with no
+    sources or file sets.
+
+  ``backtrace``
+    Optional member that is present when a CMake language backtrace to
+    the command invocation that created this relationship is available.
+    The value is an unsigned integer 0-based index into the
+    ``backtraceGraph`` member's ``nodes`` array.
+
+  ``fromDependency``
+    Optional member that is only present when the relationship is the result of
+    an :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` target property on one of
+    this target's directly or transitively linked libraries.  It is a JSON
+    object with one member:
+
+    ``id``
+      A string uniquely identifying the target whose
+      :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` property created the
+      relationship.  The value matches the main ``id`` member of that target.
+
+  This field was added in codemodel version 2.9.
+
+``interfaceCompileDependencies``
+  Optional member that may be present when the target has one or more interface
+  linking relationships to other targets.  It contains items that affect how
+  consumers' sources are compiled.  These relationships are defined by the
+  target's :prop_tgt:`INTERFACE_LINK_LIBRARIES` property.
+
+  Relationships that only apply linking requirements (such as being wrapped
+  in a :genex:`$<LINK_ONLY:...>` expression) will not be present in this
+  member.
+
+  The value is a JSON array of entries.  Each entry is a JSON object with
+  members:
+
+  ``id``
+    A string uniquely identifying the target on which this target specifies
+    an interface relationship.  This matches the main ``id`` member of the
+    other target.
+
+    The target this ``id`` identifies is not necessarily part of the build
+    system.  It may be an imported target or an interface library with no
+    sources or file sets.
+
+  ``backtrace``
+    Optional member that is present when a CMake language backtrace to
+    the command invocation that created this relationship is available.
+    The value is an unsigned integer 0-based index into the
+    ``backtraceGraph`` member's ``nodes`` array.
+
+  This field was added in codemodel version 2.9.
+
+``objectDependencies``
+  Optional member that is present when the target has one or more entries in
+  its :prop_tgt:`SOURCES` property where the entry is specified using
+  :genex:`$<TARGET_OBJECTS:...>`, and where no other generator expression is
+  used within the :genex:`$<TARGET_OBJECTS:...>` expression.
+
+  The value is a JSON array of entries.  Each entry is a JSON object with
+  members:
+
+  ``id``
+    A string uniquely identifying the target whose objects are referred to in
+    the :genex:`$<TARGET_OBJECTS:...>` expression.  This matches the main
+    ``id`` member of that other target.
+
+  ``backtrace``
+    Optional member that is present when a CMake language backtrace to
+    the command invocation that created this dependency is available.
+    The value is an unsigned integer 0-based index into the
+    ``backtraceGraph`` member's ``nodes`` array.
+
+  This field was added in codemodel version 2.9.
+
+``orderDependencies``
+  Optional member that is present when the target has one or more direct order
+  dependencies on other targets.  Such dependencies may arise from calls to
+  :command:`add_dependencies` or from internal CMake processing.
+  Unlike the ``dependencies`` array, the ``ZERO_CHECK`` target will not be
+  included in ``orderDependencies`` (this is only relevant for
+  :generator:`Xcode` and :ref:`Visual Studio <Visual Studio Generators>`
+  generators).
+
+  The value is a JSON array of entries.  Each entry is a JSON object with
+  members:
+
+  ``id``
+    A string uniquely identifying the target on which this target depends.
+    This matches the main ``id`` member of the other target.
+
+  ``backtrace``
+    Optional member that is present when a CMake language backtrace to
+    the command invocation that created this dependency is available.
+    The value is an unsigned integer 0-based index into the
+    ``backtraceGraph`` member's ``nodes`` array.
+
+  This field was added in codemodel version 2.9.
+
 ``fileSets``
   An optional member that is present when a target defines one or more
   file sets.  The value is a JSON array of entries corresponding to the

+ 140 - 0
Help/manual/file_api/schema_target.json

@@ -372,6 +372,128 @@
         "additionalProperties": false
       }
     },
+    "linkLibrariesV2_9": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Unique identifier of the target for the dependency"
+          },
+          "fragment": {
+            "type": "string",
+            "description": "Raw linker command line arguments that capture the dependency"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into backtraceGraph nodes array of the command that created the dependency, if available"
+          },
+          "fromDependency": {
+            "type": "object",
+            "properties": {
+              "id": {
+                "type": "string",
+                "description": "Unique identifier of another target whose INTERFACE_LINK_LIBRARIES_DIRECT property created this dependency"
+              }
+            }
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "interfaceLinkLibrariesV2_9": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Unique identifier of the target for the dependency"
+          },
+          "fragment": {
+            "type": "string",
+            "description": "Raw linker command line arguments that capture the dependency"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into backtraceGraph nodes array of the command that created the dependency, if available"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileDependenciesV2_9": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "id"
+        ],
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Unique identifier of the target for the dependency"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into backtraceGraph nodes array of the command that created the dependency, if available"
+          },
+          "fromDependency": {
+            "type": "object",
+            "properties": {
+              "id": {
+                "type": "string",
+                "description": "Unique identifier of another target whose INTERFACE_LINK_LIBRARIES_DIRECT property created this dependency"
+              }
+            }
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "interfaceCompileDependenciesV2_9": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "id"
+        ],
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Unique identifier of the target for the dependency"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into backtraceGraph nodes array of the command that created the dependency, if available"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "onlyTargetDependenciesArrayV2_9": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Unique identifier of the target for the dependency"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into backtraceGraph nodes array of the command that created the dependency, if available"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
     "fileSetsV2_5": {
       "type": "array",
       "items": {
@@ -1414,6 +1536,24 @@
         "dependencies": {
           "$ref": "#/definitions/dependencies"
         },
+        "linkLibraries": {
+          "$ref": "#/definitions/linkLibrariesV2_9"
+        },
+        "interfaceLinkLibraries": {
+          "$ref": "#/definitions/interfaceLinkLibrariesV2_9"
+        },
+        "compileDependencies": {
+          "$ref": "#/definitions/compileDependenciesV2_9"
+        },
+        "interfaceCompileDependencies": {
+          "$ref": "#/definitions/interfaceCompileDependenciesV2_9"
+        },
+        "objectDependencies": {
+          "$ref": "#/definitions/onlyTargetDependenciesArrayV2_9"
+        },
+        "orderDependencies": {
+          "$ref": "#/definitions/onlyTargetDependenciesArrayV2_9"
+        },
         "fileSets": {
           "$ref": "#/definitions/fileSetsV2_5"
         },

+ 5 - 0
Help/release/dev/fileapi-direct-dependencies.rst

@@ -15,3 +15,8 @@ fileapi-direct-dependencies
   * Entries in the ``directories`` and ``projects`` arrays of the "codemodel"
     object's ``configurations`` entries gained a new ``abstractTargetIndexes``
     array.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
+  new ``linkLibraries``, ``interfaceLinkLibraries``, ``compileDependencies``,
+  ``interfaceCompileDependencies``, ``objectDependencies``, and
+  ``orderDependencies`` fields.

+ 1 - 1
Source/cmComputeTargetDepends.cxx

@@ -221,7 +221,7 @@ void cmComputeTargetDepends::CollectTargetDepends(size_t depender_index)
 
       if (cmLinkImplementation const* impl = depender->GetLinkImplementation(
             it, cmGeneratorTarget::UseTo::Link)) {
-        for (cmLinkImplItem const& lib : impl->Libraries) {
+        for (cmLinkItem const& lib : impl->Libraries) {
           // Don't emit the same library twice for this target.
           if (emitted.insert(lib).second) {
             this->AddTargetDepend(depender_index, lib, true, false);

+ 5 - 5
Source/cmEvaluatedTargetProperty.cxx

@@ -14,8 +14,8 @@
 struct cmGeneratorExpressionDAGChecker;
 
 EvaluatedTargetPropertyEntry::EvaluatedTargetPropertyEntry(
-  cmLinkImplItem const& item, cmListFileBacktrace bt)
-  : LinkImplItem(item)
+  cmLinkItem const& item, cmListFileBacktrace bt)
+  : LinkItem(item)
   , Backtrace(std::move(bt))
 {
 }
@@ -25,7 +25,7 @@ EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry(
   cmGeneratorExpressionDAGChecker* dagChecker,
   cmGeneratorTarget::TargetPropertyEntry& entry)
 {
-  EvaluatedTargetPropertyEntry ee(entry.LinkImplItem, entry.GetBacktrace());
+  EvaluatedTargetPropertyEntry ee(entry.LinkItem, entry.GetBacktrace());
   cmExpandList(entry.Evaluate(context, thisTarget, dagChecker), ee.Values);
   if (entry.GetHadContextSensitiveCondition()) {
     ee.ContextDependent = true;
@@ -55,9 +55,9 @@ void addInterfaceEntry(cmGeneratorTarget const* headTarget,
                        cmGeneratorExpressionDAGChecker* dagChecker,
                        EvaluatedTargetPropertyEntries& entries,
                        cmGeneratorTarget::UseTo usage,
-                       std::vector<cmLinkImplItem> const& libraries)
+                       std::vector<cmLinkItem> const& libraries)
 {
-  for (cmLinkImplItem const& lib : libraries) {
+  for (cmLinkItem const& lib : libraries) {
     if (lib.Target) {
       EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace);
       // Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our

+ 3 - 4
Source/cmEvaluatedTargetProperty.h

@@ -15,15 +15,14 @@ struct Context;
 }
 }
 
-class cmLinkImplItem;
+class cmLinkItem;
 struct cmGeneratorExpressionDAGChecker;
 
 // Represent a target property entry after evaluating generator expressions
 // and splitting up lists.
 struct EvaluatedTargetPropertyEntry
 {
-  EvaluatedTargetPropertyEntry(cmLinkImplItem const& item,
-                               cmListFileBacktrace bt);
+  EvaluatedTargetPropertyEntry(cmLinkItem const& item, cmListFileBacktrace bt);
 
   // Move-only.
   EvaluatedTargetPropertyEntry(EvaluatedTargetPropertyEntry&&) = default;
@@ -33,7 +32,7 @@ struct EvaluatedTargetPropertyEntry
   EvaluatedTargetPropertyEntry& operator=(
     EvaluatedTargetPropertyEntry const&) = delete;
 
-  cmLinkImplItem const& LinkImplItem;
+  cmLinkItem const& LinkItem;
   cmListFileBacktrace Backtrace;
   std::vector<std::string> Values;
   bool ContextDependent = false;

+ 145 - 0
Source/cmFileAPICodemodel.cxx

@@ -41,6 +41,7 @@
 #include "cmInstallScriptGenerator.h"
 #include "cmInstallSubdirectoryGenerator.h"
 #include "cmInstallTargetGenerator.h"
+#include "cmLinkItem.h"
 #include "cmLinkLineComputer.h" // IWYU pragma: keep
 #include "cmList.h"
 #include "cmListFileCache.h"
@@ -521,6 +522,13 @@ class Target
                                   std::string const& role = std::string());
   Json::Value DumpDependencies();
   Json::Value DumpDependency(cmTargetDepend const& td);
+
+  Json::Value DumpLinkItem(cmLinkItem const& linkItem);
+  Json::Value DumpLinkImplementationLibraries(cmGeneratorTarget::UseTo usage);
+  Json::Value DumpLinkInterfaceLibraries(cmGeneratorTarget::UseTo usage);
+  Json::Value DumpObjectDependencies();
+  Json::Value DumpOrderDependencies();
+
   Json::Value DumpFolder();
   Json::Value DumpLauncher(char const* name, char const* type);
   Json::Value DumpLaunchers();
@@ -1322,6 +1330,36 @@ Json::Value Target::Dump()
   }
 
   {
+    Json::Value linkLibraries =
+      this->DumpLinkImplementationLibraries(cmGeneratorTarget::UseTo::Link);
+    if (!linkLibraries.empty()) {
+      target["linkLibraries"] = std::move(linkLibraries);
+    }
+    Json::Value ifaceLinkLibraries =
+      this->DumpLinkInterfaceLibraries(cmGeneratorTarget::UseTo::Link);
+    if (!ifaceLinkLibraries.empty()) {
+      target["interfaceLinkLibraries"] = std::move(ifaceLinkLibraries);
+    }
+    Json::Value compileDependencies =
+      this->DumpLinkImplementationLibraries(cmGeneratorTarget::UseTo::Compile);
+    if (!compileDependencies.empty()) {
+      target["compileDependencies"] = std::move(compileDependencies);
+    }
+    Json::Value ifaceCompileDependencies =
+      this->DumpLinkInterfaceLibraries(cmGeneratorTarget::UseTo::Compile);
+    if (!ifaceCompileDependencies.empty()) {
+      target["interfaceCompileDependencies"] =
+        std::move(ifaceCompileDependencies);
+    }
+    Json::Value objectDependencies = this->DumpObjectDependencies();
+    if (!objectDependencies.empty()) {
+      target["objectDependencies"] = std::move(objectDependencies);
+    }
+    Json::Value orderDependencies = this->DumpOrderDependencies();
+    if (!orderDependencies.empty()) {
+      target["orderDependencies"] = std::move(orderDependencies);
+    }
+
     if (!this->GT->IsImported()) {
       this->ProcessLanguages();
     }
@@ -2170,6 +2208,113 @@ Json::Value Target::DumpDependency(cmTargetDepend const& td)
   return dependency;
 }
 
+Json::Value Target::DumpLinkItem(cmLinkItem const& linkItem)
+{
+  Json::Value itemJson = Json::objectValue;
+  if (linkItem.Target) {
+    itemJson["id"] = TargetId(linkItem.Target, this->TopBuild);
+  } else {
+    itemJson["fragment"] = linkItem.AsStr();
+  }
+  if (linkItem.InterfaceDirectFrom) {
+    Json::Value jsonDirectFrom = Json::objectValue;
+    jsonDirectFrom["id"] =
+      TargetId(linkItem.InterfaceDirectFrom, this->TopBuild);
+    itemJson["fromDependency"] = jsonDirectFrom;
+  }
+  this->AddBacktrace(itemJson, linkItem.Backtrace);
+  return itemJson;
+}
+
+Json::Value Target::DumpLinkImplementationLibraries(
+  cmGeneratorTarget::UseTo usage)
+{
+  Json::Value jsonLibs = Json::arrayValue;
+
+  cmLinkImplementationLibraries const* implLibs =
+    this->GT->GetLinkImplementationLibraries(this->Config, usage);
+  if (implLibs) {
+    for (cmLinkItem const& linkItem : implLibs->Libraries) {
+      // Non-target compile items are never used, so we drop them here too
+      if (usage == cmGeneratorTarget::UseTo::Link || linkItem.Target) {
+        jsonLibs.append(this->DumpLinkItem(linkItem));
+      }
+    }
+  }
+  return jsonLibs;
+}
+
+Json::Value Target::DumpLinkInterfaceLibraries(cmGeneratorTarget::UseTo usage)
+{
+  Json::Value jsonLibs = Json::arrayValue;
+
+  cmLinkInterfaceLibraries const* ifaceLibs =
+    this->GT->GetLinkInterfaceLibraries(this->Config, this->GT, usage);
+  if (ifaceLibs) {
+    for (cmLinkItem const& linkItem : ifaceLibs->Libraries) {
+      // Non-target compile items are never used, so we drop them here too
+      if (usage == cmGeneratorTarget::UseTo::Link || linkItem.Target) {
+        jsonLibs.append(this->DumpLinkItem(linkItem));
+      }
+    }
+  }
+  return jsonLibs;
+}
+
+Json::Value Target::DumpObjectDependencies()
+{
+  // Object dependencies are a special case. They cannot be config-specific
+  // because they are obtained by matching the pattern $<TARGET_OBJECTS:xxx>
+  // against the SOURCES property, and the matcher rejects any cases where
+  // "xxx" contains a generator expression. We can't use
+  // GetSourceObjectLibraries() either because that also returns object
+  // libraries added via LINK_LIBRARIES rather than $<TARGET_OBJECTS:xxx>,
+  // and the whole point of orderDependencies is to capture those that are
+  // not listed in LINK_LIBRARIES.
+  std::vector<BT<cmGeneratorTarget*>> objectLibraries;
+  this->GT->GetObjectLibrariesInSources(objectLibraries);
+
+  // We don't want to repeat the same target in the list. We will only
+  // retain one backtrace for cases where the same target is added multiple
+  // times from different commands. We also need a deterministic ordering,
+  // so we can't use cmGeneratorTarget* pointers in a std::set here.
+  using TargetIdMap = std::map<std::string, BT<cmGeneratorTarget*>>;
+  TargetIdMap uniqueObjectLibraries;
+  for (BT<cmGeneratorTarget*> const& target : objectLibraries) {
+    uniqueObjectLibraries[TargetId(target.Value, this->TopBuild)] = target;
+  }
+
+  Json::Value jsonDependencies = Json::arrayValue;
+  for (TargetIdMap::value_type const& idTargetPair : uniqueObjectLibraries) {
+    Json::Value jsonDependency = Json::objectValue;
+    jsonDependency["id"] = idTargetPair.first;
+    this->AddBacktrace(jsonDependency, idTargetPair.second.Backtrace);
+    jsonDependencies.append(jsonDependency);
+  }
+  return jsonDependencies;
+}
+
+Json::Value Target::DumpOrderDependencies()
+{
+  // The generated build systems don't account for per-config dependencies.
+  // This is due to limitations of Xcode and/or Visual Studio, which have
+  // (or at least once had) no way to express a per-config inter-target
+  // dependency.
+  Json::Value jsonDependencies = Json::arrayValue;
+  for (cmLinkItem const& linkItem : this->GT->GetUtilityItems()) {
+    // We don't want to dump dependencies on reserved targets like ZERO_CHECK
+    if (linkItem.Target &&
+        cmGlobalGenerator::IsReservedTarget(linkItem.Target->GetName())) {
+      continue;
+    }
+    Json::Value jsonDependency = Json::objectValue;
+    jsonDependency["id"] = TargetId(linkItem.Target, this->TopBuild);
+    this->AddBacktrace(jsonDependency, linkItem.Backtrace);
+    jsonDependencies.append(jsonDependency);
+  }
+  return jsonDependencies;
+}
+
 Json::Value Target::DumpFolder()
 {
   Json::Value folder;

+ 1 - 1
Source/cmGeneratorExpressionNode.cxx

@@ -2921,7 +2921,7 @@ static std::string getLinkedTargetsContent(
   if (cmLinkImplementationLibraries const* impl =
         target->GetLinkImplementationLibraries(
           eval->Context.Config, cmGeneratorTarget::UseTo::Compile)) {
-    for (cmLinkImplItem const& lib : impl->Libraries) {
+    for (cmLinkItem const& lib : impl->Libraries) {
       if (lib.Target) {
         // Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
         // caller's property and hand-evaluate it as if it were compiled.

+ 2 - 2
Source/cmGeneratorTarget.cxx

@@ -4953,7 +4953,7 @@ bool cmGeneratorTarget::GetConfigCommonSourceFilesForXcode(
 }
 
 void cmGeneratorTarget::GetObjectLibrariesInSources(
-  std::vector<cmGeneratorTarget*>& objlibs) const
+  std::vector<BT<cmGeneratorTarget*>>& objlibs) const
 {
   // FIXME: This searches SOURCES for TARGET_OBJECTS for backwards
   // compatibility with the OLD behavior of CMP0026 since this
@@ -4974,7 +4974,7 @@ void cmGeneratorTarget::GetObjectLibrariesInSources(
         cmGeneratorTarget* objLib =
           this->LocalGenerator->FindGeneratorTargetToUse(objLibName);
         if (objLib) {
-          objlibs.push_back(objLib);
+          objlibs.emplace_back(objLib, entry.Backtrace);
         }
       }
     }

+ 8 - 5
Source/cmGeneratorTarget.h

@@ -511,7 +511,7 @@ public:
   bool IsDotNetSdkTarget() const;
 
   void GetObjectLibrariesInSources(
-    std::vector<cmGeneratorTarget*>& objlibs) const;
+    std::vector<BT<cmGeneratorTarget*>>& objlibs) const;
 
   std::string GetFullNameImported(std::string const& config,
                                   cmStateEnums::ArtifactType artifact) const;
@@ -1456,6 +1456,9 @@ private:
   cmValue GetPropertyWithPairedLanguageSupport(std::string const& lang,
                                                char const* suffix) const;
 
+  std::vector<cmLinkItem> ComputeImplicitLanguageTargets(
+    std::string const& lang, std::string const& config) const;
+
   void ComputeLinkImplementationRuntimeLibraries(
     std::string const& config, cmOptionalLinkImplementation& impl) const;
 
@@ -1568,10 +1571,10 @@ private:
 class cmGeneratorTarget::TargetPropertyEntry
 {
 protected:
-  static cmLinkImplItem NoLinkImplItem;
+  static cmLinkItem NoLinkItem;
 
 public:
-  TargetPropertyEntry(cmLinkImplItem const& item);
+  TargetPropertyEntry(cmLinkItem const& item);
   virtual ~TargetPropertyEntry() = default;
 
   static std::unique_ptr<TargetPropertyEntry> Create(
@@ -1580,7 +1583,7 @@ public:
   static std::unique_ptr<TargetPropertyEntry> CreateFileSet(
     std::vector<std::string> dirs, bool contextSensitiveDirs,
     std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
-    cmFileSet const* fileSet, cmLinkImplItem const& item = NoLinkImplItem);
+    cmFileSet const* fileSet, cmLinkItem const& item = NoLinkItem);
 
   virtual std::string const& Evaluate(
     cm::GenEx::Context const& context, cmGeneratorTarget const* headTarget,
@@ -1590,5 +1593,5 @@ public:
   virtual std::string const& GetInput() const = 0;
   virtual bool GetHadContextSensitiveCondition() const;
 
-  cmLinkImplItem const& LinkImplItem;
+  cmLinkItem const& LinkItem;
 };

+ 3 - 3
Source/cmGeneratorTarget_IncludeDirectories.cxx

@@ -105,7 +105,7 @@ void AddLangSpecificImplicitIncludeDirectories(
       target, propertyName, nullptr, nullptr, context, target->GetBacktrace(),
     };
 
-    for (cmLinkImplItem const& library : libraries->Libraries) {
+    for (cmLinkItem const& library : libraries->Libraries) {
       if (cmGeneratorTarget const* dependency = library.Target) {
         if (!dependency->IsInBuildSystem()) {
           continue;
@@ -146,7 +146,7 @@ void processIncludeDirectories(cmGeneratorTarget const* tgt,
                                bool debugIncludes)
 {
   for (EvaluatedTargetPropertyEntry& entry : entries.Entries) {
-    cmLinkImplItem const& item = entry.LinkImplItem;
+    cmLinkItem const& item = entry.LinkItem;
     std::string const& targetName = item.AsStr();
     bool const fromImported = item.Target && item.Target->IsImported();
 
@@ -273,7 +273,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
   if (this->IsApple()) {
     if (cmLinkImplementationLibraries const* impl =
           this->GetLinkImplementationLibraries(config, UseTo::Compile)) {
-      for (cmLinkImplItem const& lib : impl->Libraries) {
+      for (cmLinkItem const& lib : impl->Libraries) {
         std::string libDir;
         if (!lib.Target) {
           libDir = cmSystemTools::CollapseFullPath(

+ 20 - 44
Source/cmGeneratorTarget_Link.cxx

@@ -208,7 +208,7 @@ bool cmGeneratorTarget::ComputeLinkClosure(std::string const& config,
   // secondPass);
   cmTargetCollectLinkLanguages linkLangs(this, config, languages, this,
                                          secondPass);
-  for (cmLinkImplItem const& lib : impl->Libraries) {
+  for (cmLinkItem const& lib : impl->Libraries) {
     linkLangs.Visit(lib);
   }
 
@@ -336,7 +336,7 @@ cmGeneratorTarget::GetLinkImplementationClosure(std::string const& config,
       this->GetLinkImplementationLibraries(config, usage);
     assert(impl);
 
-    for (cmLinkImplItem const& lib : impl->Libraries) {
+    for (cmLinkItem const& lib : impl->Libraries) {
       processILibs(config, this, lib,
                    this->LocalGenerator->GetGlobalGenerator(), tgts, emitted,
                    usage);
@@ -384,7 +384,7 @@ void cmGeneratorTarget::CheckLinkLibraries() const
 
   // Check link the implementation for each generated configuration.
   for (auto const& impl : this->LinkImplMap) {
-    for (cmLinkImplItem const& item : impl.second.Libraries) {
+    for (cmLinkItem const& item : impl.second.Libraries) {
       if (!this->VerifyLinkItemColons(LinkItemRole::Implementation, item)) {
         return;
       }
@@ -583,6 +583,7 @@ void cmGeneratorTarget::ExpandLinkItems(std::string const& prop,
         cmLinkItem item = std::move(*maybeItem);
 
         if (field == LinkInterfaceField::HeadInclude) {
+          item.InterfaceDirectFrom = this;
           iface.HeadInclude.emplace_back(std::move(item));
           continue;
         }
@@ -686,7 +687,7 @@ void cmGeneratorTarget::ComputeLinkInterface(std::string const& config,
     if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
       cmLinkImplementation const* impl =
         this->GetLinkImplementation(config, UseTo::Link, secondPass);
-      for (cmLinkImplItem const& lib : impl->Libraries) {
+      for (cmLinkItem const& lib : impl->Libraries) {
         if (emitted.insert(lib).second) {
           if (lib.Target) {
             // This is a runtime dependency on another shared library.
@@ -813,54 +814,31 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
                         LinkInterfaceField::HeadExclude, iface);
 }
 
-namespace {
-
-template <typename ReturnType>
-ReturnType constructItem(cmGeneratorTarget* target,
-                         cmListFileBacktrace const& bt);
-
-template <>
-inline cmLinkImplItem constructItem(cmGeneratorTarget* target,
-                                    cmListFileBacktrace const& bt)
-{
-  return cmLinkImplItem(cmLinkItem(target, false, bt));
-}
-
-template <>
-inline cmLinkItem constructItem(cmGeneratorTarget* target,
-                                cmListFileBacktrace const& bt)
-{
-  return cmLinkItem(target, false, bt);
-}
-
-template <typename ValueType>
-std::vector<ValueType> computeImplicitLanguageTargets(
-  std::string const& lang, std::string const& config,
-  cmGeneratorTarget const* currentTarget)
+std::vector<cmLinkItem> cmGeneratorTarget::ComputeImplicitLanguageTargets(
+  std::string const& lang, std::string const& config) const
 {
   cmListFileBacktrace bt;
-  std::vector<ValueType> result;
-  cmLocalGenerator* lg = currentTarget->GetLocalGenerator();
+  std::vector<cmLinkItem> result;
+  cmLocalGenerator* lg = this->GetLocalGenerator();
 
   std::string const& runtimeLibrary =
-    currentTarget->GetRuntimeLinkLibrary(lang, config);
-  if (cmValue runtimeLinkOptions = currentTarget->Makefile->GetDefinition(
+    this->GetRuntimeLinkLibrary(lang, config);
+  if (cmValue runtimeLinkOptions = this->Makefile->GetDefinition(
         "CMAKE_" + lang + "_RUNTIME_LIBRARIES_" + runtimeLibrary)) {
     cmList libsList{ *runtimeLinkOptions };
     result.reserve(libsList.size());
 
     for (auto const& i : libsList) {
       cmGeneratorTarget::TargetOrString resolved =
-        currentTarget->ResolveTargetReference(i, lg);
+        this->ResolveTargetReference(i, lg);
       if (resolved.Target) {
-        result.emplace_back(constructItem<ValueType>(resolved.Target, bt));
+        result.emplace_back(resolved.Target, false, bt);
       }
     }
   }
 
   return result;
 }
-}
 
 void cmGeneratorTarget::ComputeLinkInterfaceRuntimeLibraries(
   std::string const& config, cmOptionalLinkInterface& iface) const
@@ -869,9 +847,8 @@ void cmGeneratorTarget::ComputeLinkInterfaceRuntimeLibraries(
     if ((lang == "CUDA" || lang == "HIP") &&
         iface.LanguageRuntimeLibraries.find(lang) ==
           iface.LanguageRuntimeLibraries.end()) {
-      auto implicitTargets =
-        computeImplicitLanguageTargets<cmLinkItem>(lang, config, this);
-      iface.LanguageRuntimeLibraries[lang] = std::move(implicitTargets);
+      iface.LanguageRuntimeLibraries[lang] =
+        this->ComputeImplicitLanguageTargets(lang, config);
     }
   }
 }
@@ -883,9 +860,8 @@ void cmGeneratorTarget::ComputeLinkImplementationRuntimeLibraries(
     if ((lang == "CUDA" || lang == "HIP") &&
         impl.LanguageRuntimeLibraries.find(lang) ==
           impl.LanguageRuntimeLibraries.end()) {
-      auto implicitTargets =
-        computeImplicitLanguageTargets<cmLinkImplItem>(lang, config, this);
-      impl.LanguageRuntimeLibraries[lang] = std::move(implicitTargets);
+      impl.LanguageRuntimeLibraries[lang] =
+        this->ComputeImplicitLanguageTargets(lang, config);
     }
   }
 }
@@ -1093,7 +1069,7 @@ void TransitiveLinkImpl::Follow(cmGeneratorTarget const* target)
 void TransitiveLinkImpl::Compute()
 {
   // Save the original items and start with an empty list.
-  std::vector<cmLinkImplItem> original = std::move(this->Impl.Libraries);
+  std::vector<cmLinkItem> original = std::move(this->Impl.Libraries);
 
   // Avoid injecting any original items as usage requirements.
   // This gives LINK_LIBRARIES final control over the order
@@ -1101,7 +1077,7 @@ void TransitiveLinkImpl::Compute()
   this->Emitted.insert(original.cbegin(), original.cend());
 
   // Process each original item.
-  for (cmLinkImplItem& item : original) {
+  for (cmLinkItem& item : original) {
     // Inject direct dependencies listed in 'INTERFACE_LINK_LIBRARIES_DIRECT'
     // usage requirements before the item itself.
     this->Follow(item.Target);
@@ -1114,7 +1090,7 @@ void TransitiveLinkImpl::Compute()
   // usage requirements found through any dependency above.
   this->Impl.Libraries.erase(
     std::remove_if(this->Impl.Libraries.begin(), this->Impl.Libraries.end(),
-                   [this](cmLinkImplItem const& item) {
+                   [this](cmLinkItem const& item) {
                      return this->Excluded.find(item) != this->Excluded.end();
                    }),
     this->Impl.Libraries.end());

+ 1 - 1
Source/cmGeneratorTarget_LinkDirectories.cxx

@@ -36,7 +36,7 @@ void processLinkDirectories(cmGeneratorTarget const* tgt,
                             bool debugDirectories)
 {
   for (EvaluatedTargetPropertyEntry& entry : entries.Entries) {
-    cmLinkImplItem const& item = entry.LinkImplItem;
+    cmLinkItem const& item = entry.LinkItem;
     std::string const& targetName = item.AsStr();
 
     std::string usedDirectories;

+ 2 - 2
Source/cmGeneratorTarget_Sources.cxx

@@ -55,7 +55,7 @@ void AddObjectEntries(cmGeneratorTarget const* headTarget,
         headTarget->GetLinkImplementationLibraries(context.Config,
                                                    UseTo::Link)) {
     entries.HadContextSensitiveCondition = impl->HadContextSensitiveCondition;
-    for (cmLinkImplItem const& lib : impl->Libraries) {
+    for (cmLinkItem const& lib : impl->Libraries) {
       if (lib.Target &&
           lib.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
         std::string uniqueName =
@@ -174,7 +174,7 @@ bool processSources(cmGeneratorTarget const* tgt,
       contextDependent = true;
     }
 
-    cmLinkImplItem const& item = entry.LinkImplItem;
+    cmLinkItem const& item = entry.LinkItem;
     std::string const& targetName = item.AsStr();
 
     for (std::string& src : entry.Values) {

+ 7 - 7
Source/cmGeneratorTarget_TargetPropertyEntry.cxx

@@ -26,13 +26,13 @@ struct Context;
 class cmake;
 struct cmGeneratorExpressionDAGChecker;
 
-cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
+cmLinkItem cmGeneratorTarget::TargetPropertyEntry::NoLinkItem;
 
 class TargetPropertyEntryString : public cmGeneratorTarget::TargetPropertyEntry
 {
 public:
   TargetPropertyEntryString(BT<std::string> propertyValue,
-                            cmLinkImplItem const& item = NoLinkImplItem)
+                            cmLinkItem const& item = NoLinkItem)
     : cmGeneratorTarget::TargetPropertyEntry(item)
     , PropertyValue(std::move(propertyValue))
   {
@@ -62,7 +62,7 @@ class TargetPropertyEntryGenex : public cmGeneratorTarget::TargetPropertyEntry
 {
 public:
   TargetPropertyEntryGenex(std::unique_ptr<cmCompiledGeneratorExpression> cge,
-                           cmLinkImplItem const& item = NoLinkImplItem)
+                           cmLinkItem const& item = NoLinkItem)
     : cmGeneratorTarget::TargetPropertyEntry(item)
     , ge(std::move(cge))
   {
@@ -98,7 +98,7 @@ public:
   TargetPropertyEntryFileSet(
     std::vector<std::string> dirs, bool contextSensitiveDirs,
     std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
-    cmFileSet const* fileSet, cmLinkImplItem const& item = NoLinkImplItem)
+    cmFileSet const* fileSet, cmLinkItem const& item = NoLinkItem)
     : cmGeneratorTarget::TargetPropertyEntry(item)
     , BaseDirs(std::move(dirs))
     , ContextSensitiveDirs(contextSensitiveDirs)
@@ -171,15 +171,15 @@ std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>
 cmGeneratorTarget::TargetPropertyEntry::CreateFileSet(
   std::vector<std::string> dirs, bool contextSensitiveDirs,
   std::unique_ptr<cmCompiledGeneratorExpression> entryCge,
-  cmFileSet const* fileSet, cmLinkImplItem const& item)
+  cmFileSet const* fileSet, cmLinkItem const& item)
 {
   return cm::make_unique<TargetPropertyEntryFileSet>(
     std::move(dirs), contextSensitiveDirs, std::move(entryCge), fileSet, item);
 }
 
 cmGeneratorTarget::TargetPropertyEntry::TargetPropertyEntry(
-  cmLinkImplItem const& item)
-  : LinkImplItem(item)
+  cmLinkItem const& item)
+  : LinkItem(item)
 {
 }
 

+ 5 - 5
Source/cmGlobalXCodeGenerator.cxx

@@ -5053,10 +5053,10 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile(
           }
         }
 
-        std::vector<cmGeneratorTarget*> objlibs;
+        std::vector<BT<cmGeneratorTarget*>> objlibs;
         gt->GetObjectLibrariesInSources(objlibs);
-        for (auto* objLib : objlibs) {
-          makefileStream << this->PostBuildMakeTarget(objLib->GetName(),
+        for (auto const& objLib : objlibs) {
+          makefileStream << this->PostBuildMakeTarget(objLib.Value->GetName(),
                                                       configName)
                          << ": " << trel << '\n';
         }
@@ -5074,9 +5074,9 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile(
           }
         }
 
-        for (auto* objLib : objlibs) {
+        for (auto const& objLib : objlibs) {
 
-          std::string const objLibName = objLib->GetName();
+          std::string const& objLibName = objLib.Value->GetName();
           std::string d = cmStrCat(this->GetTargetTempDir(gt, configName),
                                    "/lib", objLibName, ".a");
 

+ 0 - 5
Source/cmLinkItem.cxx

@@ -71,11 +71,6 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
   return os << item.AsStr();
 }
 
-cmLinkImplItem::cmLinkImplItem(cmLinkItem item)
-  : cmLinkItem(std::move(item))
-{
-}
-
 namespace {
 cm::string_view const LL_BEGIN = "<LINK_LIBRARY:"_s;
 cm::string_view const LL_END = "</LINK_LIBRARY:"_s;

+ 5 - 9
Source/cmLinkItem.h

@@ -41,25 +41,21 @@ public:
   cmSourceFile const* ObjectSource = nullptr;
   std::string Feature;
   bool Cross = false;
+  // When the item was the result of a target's INTERFACE_LINK_LIBRARIES_DIRECT
+  // property, that originating target is provided here
+  cmGeneratorTarget const* InterfaceDirectFrom = nullptr;
   cmListFileBacktrace Backtrace;
   friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
   friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
   friend std::ostream& operator<<(std::ostream& os, cmLinkItem const& item);
 };
 
-class cmLinkImplItem : public cmLinkItem
-{
-public:
-  cmLinkImplItem() = default;
-  cmLinkImplItem(cmLinkItem item);
-};
-
 /** The link implementation specifies the direct library
     dependencies needed by the object files of the target.  */
 struct cmLinkImplementationLibraries
 {
   // Libraries linked directly in this configuration.
-  std::vector<cmLinkImplItem> Libraries;
+  std::vector<cmLinkItem> Libraries;
 
   // Object files linked directly in this configuration.
   std::vector<cmLinkItem> Objects;
@@ -124,7 +120,7 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries
 {
   // Languages whose runtime libraries must be linked.
   std::vector<std::string> Languages;
-  std::unordered_map<std::string, std::vector<cmLinkImplItem>>
+  std::unordered_map<std::string, std::vector<cmLinkItem>>
     LanguageRuntimeLibraries;
 
   // Whether the list depends on a link language genex.

+ 4 - 3
Source/cmLinkItemGraphVisitor.cxx

@@ -8,6 +8,7 @@
 
 #include "cmGeneratorTarget.h"
 #include "cmLinkItem.h"
+#include "cmListFileCache.h"
 #include "cmMakefile.h"
 
 void cmLinkItemGraphVisitor::VisitItem(cmLinkItem const& item)
@@ -120,12 +121,12 @@ void cmLinkItemGraphVisitor::GetDependencies(cmGeneratorTarget const& target,
     }
   }
 
-  std::vector<cmGeneratorTarget*> objectLibraries;
+  std::vector<BT<cmGeneratorTarget*>> objectLibraries;
   target.GetObjectLibrariesInSources(objectLibraries);
   for (auto const& lib : objectLibraries) {
-    auto const& name = lib->GetName();
+    auto const& name = lib.Value->GetName();
     if (dependencies.find(name) == dependencies.cend()) {
-      auto objectItem = cmLinkItem(lib, false, lib->GetBacktrace());
+      auto objectItem = cmLinkItem(lib.Value, false, lib.Backtrace);
       dependencies[name] = Dependency(DependencyType::Object, objectItem);
     }
   }

+ 1 - 1
Source/cmLinkLineDeviceComputer.cxx

@@ -159,7 +159,7 @@ void cmLinkLineDeviceComputer::ComputeLinkLibraries(
         cli.GetTarget()->GetLinkImplementation(cli.GetConfig(),
                                                cmGeneratorTarget::UseTo::Link);
 
-      for (cmLinkImplItem const& iter : linkImpl->Libraries) {
+      for (cmLinkItem const& iter : linkImpl->Libraries) {
         if (iter.Target &&
             iter.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
           std::string libPath = iter.Target->GetLocation(cli.GetConfig());

+ 155 - 3
Tests/RunCMake/FileAPI/codemodel-v2-check.py

@@ -567,6 +567,144 @@ def check_target(c, major, minor):
                              missing_exception=lambda e: "Dependency ID: %s" % e["id"],
                              extra_exception=lambda a: "Dependency ID: %s" % a["id"])
 
+        def is_same_link_library(actual, expected):
+            if "id" in actual:
+                return expected["id"] is not None and matches(actual["id"], expected["id"])
+            if "fragment" in actual:
+                return expected["fragment"] is not None and is_string(actual["fragment"], expected["fragment"])
+            assert False  # actual must have one of id or fragment
+
+        if expected["linkLibraries"] is not None:
+            expected_keys.append("linkLibraries")
+
+            def check_link_library(actual, expected):
+                assert is_dict(actual)
+                expected_keys = []
+
+                # We always require exactly one of id or fragment
+                if expected["id"] is not None:
+                    expected_keys.append("id")
+                    assert matches(actual["id"], expected["id"])
+                    assert "fragment" not in actual
+                else:
+                    expected_keys.append("fragment")
+                    assert is_string(actual["fragment"], expected["fragment"])
+                    assert "id" not in actual
+
+                if expected["backtrace"] is not None:
+                    expected_keys.append("backtrace")
+                    check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+                if expected["fromDependency"] is not None:
+                    expected_keys.append("fromDependency")
+                    assert is_dict(actual["fromDependency"])
+                    assert matches(actual["fromDependency"]["id"], expected["fromDependency"])
+                    assert sorted(actual["fromDependency"].keys()) == ["id"]
+
+                assert sorted(actual.keys()) == sorted(expected_keys)
+
+            check_list_match(is_same_link_library,
+                             obj["linkLibraries"], expected["linkLibraries"],
+                             check=check_link_library,
+                             check_exception=lambda a, e: "Mismatched link library: %s" % (a["id"] if "id" in a else a["fragment"]),
+                             missing_exception=lambda e: "Missing link library: %s" % (e["id"] if e["id"] is not None else e["fragment"]),
+                             extra_exception=lambda a: "Extra link library: %s" % (a["id"] if "id" in a else a["fragment"]))
+
+        if expected["interfaceLinkLibraries"] is not None:
+            expected_keys.append("interfaceLinkLibraries")
+
+            def check_interface_link_library(actual, expected):
+                assert is_dict(actual)
+                expected_keys = []
+
+                # We always require exactly one of id or fragment
+                if expected["id"] is not None:
+                    expected_keys.append("id")
+                    assert matches(actual["id"], expected["id"])
+                    assert "fragment" not in actual
+                else:
+                    expected_keys.append("fragment")
+                    assert is_string(actual["fragment"], expected["fragment"])
+                    assert "id" not in actual
+
+                if expected["backtrace"] is not None:
+                    expected_keys.append("backtrace")
+                    check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+                assert sorted(actual.keys()) == sorted(expected_keys)
+
+            check_list_match(is_same_link_library,
+                             obj["interfaceLinkLibraries"], expected["interfaceLinkLibraries"],
+                             check=check_interface_link_library,
+                             check_exception=lambda a, e: "Mismatched interface link library: %s" % (a["id"] if "id" in a else a["fragment"]),
+                             missing_exception=lambda e: "Missing interface link library: %s" % (e["id"] if e["id"] is not None else e["fragment"]),
+                             extra_exception=lambda a: "Extra interface link library: %s" % (a["id"] if "id" in a else a["fragment"]))
+
+        if expected["compileDependencies"] is not None:
+            expected_keys.append("compileDependencies")
+
+            def check_usage_dependency(actual, expected):
+                assert is_dict(actual)
+                assert matches(actual["id"], expected["id"])
+                expected_keys = ["id"]
+
+                if expected["backtrace"] is not None:
+                    expected_keys.append("backtrace")
+                    check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+                if expected["fromDependency"] is not None:
+                    expected_keys.append("fromDependency")
+                    assert is_dict(actual["fromDependency"])
+                    assert matches(actual["fromDependency"]["id"], expected["fromDependency"])
+                    assert sorted(actual["fromDependency"].keys()) == ["id"]
+
+                assert sorted(actual.keys()) == sorted(expected_keys)
+
+            check_list_match(lambda a, e: matches(a["id"], e["id"]),
+                             obj["compileDependencies"], expected["compileDependencies"],
+                             check=check_usage_dependency,
+                             check_exception=lambda a, e: "Mismatched compile dependency: %s" % a["id"],
+                             missing_exception=lambda e: "Missing compile dependency: %s" % e["id"],
+                             extra_exception=lambda a: "Extra compile dependency: %s" % a["id"])
+
+        def check_only_target_dependency(actual, expected):
+            assert is_dict(actual)
+            assert matches(actual["id"], expected["id"])
+            expected_keys = ["id"]
+
+            if expected["backtrace"] is not None:
+                expected_keys.append("backtrace")
+                check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+            assert sorted(actual.keys()) == sorted(expected_keys)
+
+        if expected["interfaceCompileDependencies"] is not None:
+            expected_keys.append("interfaceCompileDependencies")
+            check_list_match(lambda a, e: matches(a["id"], e["id"]),
+                             obj["interfaceCompileDependencies"], expected["interfaceCompileDependencies"],
+                             check=check_only_target_dependency,
+                             check_exception=lambda a, e: "Mismatched interface compile dependency: %s" % a["id"],
+                             missing_exception=lambda e: "Missing interface compile dependency: %s" % e["id"],
+                             extra_exception=lambda a: "Extra interface compile dependency: %s" % a["id"])
+
+        if expected["objectDependencies"] is not None:
+            expected_keys.append("objectDependencies")
+            check_list_match(lambda a, e: matches(a["id"], e["id"]),
+                             obj["objectDependencies"], expected["objectDependencies"],
+                             check=check_only_target_dependency,
+                             check_exception=lambda a, e: "Mismatched object dependency: %s" % a["id"],
+                             missing_exception=lambda e: "Missing object dependency: %s" % e["id"],
+                             extra_exception=lambda a: "Extra object dependency: %s" % a["id"])
+
+        if expected["orderDependencies"] is not None:
+            expected_keys.append("orderDependencies")
+            check_list_match(lambda a, e: matches(a["id"], e["id"]),
+                             obj["orderDependencies"], expected["orderDependencies"],
+                             check=check_only_target_dependency,
+                             check_exception=lambda a, e: "Mismatched order dependency: %s" % a["id"],
+                             missing_exception=lambda e: "Missing order dependency: %s" % e["id"],
+                             extra_exception=lambda a: "Extra order dependency: %s" % a["id"])
+
         if expected["sourceGroups"] is not None:
             expected_keys.append("sourceGroups")
 
@@ -798,6 +936,7 @@ def gen_check_directories(c, g):
         read_codemodel_json_data("directories/fileset.json"),
         read_codemodel_json_data("directories/subdir.json"),
         read_codemodel_json_data("directories/framework.json"),
+        read_codemodel_json_data("directories/direct.json"),
     ]
 
     if matches(g["name"], "^Visual Studio "):
@@ -905,12 +1044,21 @@ def gen_check_build_system_targets(c, g, inSource):
         read_codemodel_json_data("targets/zero_check_interface.json"),
         read_codemodel_json_data("targets/iface_srcs.json"),
 
+        read_codemodel_json_data("targets/all_build_direct.json"),
+        read_codemodel_json_data("targets/zero_check_direct.json"),
+        read_codemodel_json_data("targets/link_transitive_direct_exe.json"),
+        read_codemodel_json_data("targets/transitive_direct_lib.json"),
+        read_codemodel_json_data("targets/inject_direct_lib_impl.json"),
+        read_codemodel_json_data("targets/usage_lib.json"),
+        read_codemodel_json_data("targets/link_usage_exe.json"),
+        read_codemodel_json_data("targets/compile_usage_exe.json"),
+
         read_codemodel_json_data("targets/all_build_custom.json"),
         read_codemodel_json_data("targets/zero_check_custom.json"),
         read_codemodel_json_data("targets/custom_tgt.json"),
         read_codemodel_json_data("targets/custom_exe.json"),
         read_codemodel_json_data("targets/all_build_external.json"),
-        read_codemodel_json_data("targets/zero_check_external.json"),
+        read_codemodel_json_data("targets/zero_check_external.json"),  # Must be the last zero_check_... because matches all ZERO_CHECK::@XXX target ids
         read_codemodel_json_data("targets/generated_exe.json"),
 
         read_codemodel_json_data("targets/c_headers_1.json"),
@@ -1036,7 +1184,8 @@ def gen_check_build_system_targets(c, g, inSource):
             expected = filter_list(lambda e: e["name"] not in ("link_imported_object_exe"), expected)
             for e in expected:
                 e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^link_imported_object_exe::@"), e["dependencies"])
-                if e["name"] in ("c_object_lib", "cxx_object_lib"):
+                e["orderDependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^link_imported_object_exe::@"), e["orderDependencies"])
+                if e["name"] in ("c_object_lib", "cxx_object_lib", "inject_direct_lib_impl"):
                     e["artifacts"] = None
 
     else:
@@ -1077,7 +1226,9 @@ def gen_check_abstract_targets(c, g, inSource):
         read_codemodel_json_data("targets/imported_static_lib.json"),
 
         read_codemodel_json_data("targets/iface_none.json"),
-        read_codemodel_json_data("targets/iface_symbolic.json")
+        read_codemodel_json_data("targets/iface_symbolic.json"),
+
+        read_codemodel_json_data("targets/inject_direct_lib.json"),
     ]
 
     if sys.platform == "darwin":
@@ -1124,6 +1275,7 @@ def gen_check_projects(c, g):
         read_codemodel_json_data("projects/custom.json"),
         read_codemodel_json_data("projects/external.json"),
         read_codemodel_json_data("projects/framework.json"),
+        read_codemodel_json_data("projects/direct.json"),
     ]
 
     if matches(g["name"], "^Visual Studio "):

+ 23 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/directories/direct.json

@@ -0,0 +1,23 @@
+{
+    "source": "^direct$",
+    "build": "^direct$",
+    "parentSource": "^\\.$",
+    "childSources": null,
+    "targetIds": [
+        "^ALL_BUILD::@79b6367c9e05c77f6a80$",
+        "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+        "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+        "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+        "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+        "^usage_lib::@79b6367c9e05c77f6a80$",
+        "^link_usage_exe::@79b6367c9e05c77f6a80$",
+        "^compile_usage_exe::@79b6367c9e05c77f6a80$"
+    ],
+    "abstractTargetIds": [
+        "^inject_direct_lib::@79b6367c9e05c77f6a80$"
+    ],
+    "projectName": "Direct",
+    "minimumCMakeVersion": "3.13",
+    "hasInstallRule": null,
+    "installers": []
+}

+ 15 - 14
Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json

@@ -13,7 +13,8 @@
         "^dir$",
         "^fileset$",
         "^subdir$",
-        "^framework$"
+        "^framework$",
+        "^direct$"
     ],
     "targetIds": [
         "^ALL_BUILD::@6890427a1f51a3e7e1df$",
@@ -54,7 +55,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 51,
+                    "line": 52,
                     "command": "install",
                     "hasParent": true
                 },
@@ -99,7 +100,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 54,
+                    "line": 55,
                     "command": "install",
                     "hasParent": true
                 },
@@ -147,7 +148,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 54,
+                    "line": 55,
                     "command": "install",
                     "hasParent": true
                 },
@@ -192,7 +193,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 54,
+                    "line": 55,
                     "command": "install",
                     "hasParent": true
                 },
@@ -236,7 +237,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 54,
+                    "line": 55,
                     "command": "install",
                     "hasParent": true
                 },
@@ -280,7 +281,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 59,
+                    "line": 60,
                     "command": "install",
                     "hasParent": true
                 },
@@ -327,7 +328,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 61,
+                    "line": 62,
                     "command": "install",
                     "hasParent": true
                 },
@@ -372,7 +373,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 62,
+                    "line": 63,
                     "command": "install",
                     "hasParent": true
                 },
@@ -421,7 +422,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 63,
+                    "line": 64,
                     "command": "install",
                     "hasParent": true
                 },
@@ -473,7 +474,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 64,
+                    "line": 65,
                     "command": "install",
                     "hasParent": true
                 },
@@ -522,7 +523,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 65,
+                    "line": 66,
                     "command": "install",
                     "hasParent": true
                 },
@@ -564,7 +565,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 66,
+                    "line": 67,
                     "command": "install",
                     "hasParent": true
                 },
@@ -606,7 +607,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 67,
+                    "line": 68,
                     "command": "install",
                     "hasParent": true
                 },

+ 2 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json

@@ -9,7 +9,8 @@
         "Interface",
         "Object",
         "External",
-        "Framework"
+        "Framework",
+        "Direct"
     ],
     "directorySources": [
         "^\\.$",

+ 21 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/projects/direct.json

@@ -0,0 +1,21 @@
+{
+    "name": "Direct",
+    "parentName": "codemodel-v2",
+    "childNames": null,
+    "directorySources": [
+        "^direct$"
+    ],
+    "targetIds": [
+        "^ALL_BUILD::@79b6367c9e05c77f6a80$",
+        "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+        "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+        "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+        "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+        "^usage_lib::@79b6367c9e05c77f6a80$",
+        "^link_usage_exe::@79b6367c9e05c77f6a80$",
+        "^compile_usage_exe::@79b6367c9e05c77f6a80$"
+    ],
+    "abstractTargetIds": [
+        "^inject_direct_lib::@79b6367c9e05c77f6a80$"
+    ]
+}

+ 15 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json

@@ -86,5 +86,20 @@
             "id": "^cxx_alias_exe::@53632cba2752272bb008$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^c_alias_exe::@53632cba2752272bb008$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+            "backtrace": null
+        }
     ]
 }

+ 11 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json

@@ -82,5 +82,16 @@
             "id": "^custom_exe::@c11385ffed57b860da63$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^custom_exe::@c11385ffed57b860da63$",
+            "backtrace": null
+        }
     ]
 }

+ 55 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json

@@ -126,5 +126,60 @@
             "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        }
     ]
 }

+ 137 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_direct.json

@@ -0,0 +1,137 @@
+{
+    "name": "ALL_BUILD",
+    "id": "^ALL_BUILD::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "UTILITY",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": true,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ALL_BUILD$",
+            "isGenerated": true,
+            "fileSetName": null,
+            "sourceGroupName": "",
+            "compileGroupLanguage": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ALL_BUILD\\.rule$",
+            "isGenerated": true,
+            "fileSetName": null,
+            "sourceGroupName": "CMake Rules",
+            "compileGroupLanguage": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "",
+            "sourcePaths": [
+                "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ALL_BUILD$"
+            ]
+        },
+        {
+            "name": "CMake Rules",
+            "sourcePaths": [
+                "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ALL_BUILD\\.rule$"
+            ]
+        }
+    ],
+    "compileGroups": null,
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": null,
+    "artifacts": null,
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": null,
+    "archive": null,
+    "dependencies": [
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^compile_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^compile_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ]
+}

+ 11 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json

@@ -82,5 +82,16 @@
             "id": "^generated_exe::@[0-9a-f]+$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^generated_exe::@[0-9a-f]+$",
+            "backtrace": null
+        }
     ]
 }

+ 19 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json

@@ -90,5 +90,24 @@
             "id": "^exe_framework::@217a96c3a62328a73ef4$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^shared_framework::@217a96c3a62328a73ef4$",
+            "backtrace": null
+        },
+        {
+            "id": "^static_framework::@217a96c3a62328a73ef4$",
+            "backtrace": null
+        },
+        {
+            "id": "^exe_framework::@217a96c3a62328a73ef4$",
+            "backtrace": null
+        }
     ]
 }

+ 31 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json

@@ -102,5 +102,36 @@
             "id": "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        }
     ]
 }

+ 11 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json

@@ -82,5 +82,16 @@
             "id": "^iface_srcs::@25b7fa8ea00134654b85$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^iface_srcs::@25b7fa8ea00134654b85$",
+            "backtrace": null
+        }
     ]
 }

+ 23 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json

@@ -94,5 +94,28 @@
             "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        }
     ]
 }

+ 215 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json

@@ -237,6 +237,221 @@
         {
             "id": "^exe_framework::@217a96c3a62328a73ef4$",
             "backtrace": null
+        },
+        {
+            "id": "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^compile_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^interface_exe::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_exe::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_subdir::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_alias_exe::@53632cba2752272bb008$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        },
+        {
+            "id": "^iface_srcs::@25b7fa8ea00134654b85$",
+            "backtrace": null
+        },
+        {
+            "id": "^custom_exe::@c11385ffed57b860da63$",
+            "backtrace": null
+        },
+        {
+            "id": "^generated_exe::@[0-9a-f]+$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_headers_1::@6b8db101d64c125f29fe$",
+            "backtrace": null
+        },
+        {
+            "id": "^c_headers_2::@6b8db101d64c125f29fe$",
+            "backtrace": null
+        },
+        {
+            "id": "^static_framework::@217a96c3a62328a73ef4$",
+            "backtrace": null
+        },
+        {
+            "id": "^shared_framework::@217a96c3a62328a73ef4$",
+            "backtrace": null
+        },
+        {
+            "id": "^exe_framework::@217a96c3a62328a73ef4$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^link_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        },
+        {
+            "id": "^compile_usage_exe::@79b6367c9e05c77f6a80$",
+            "backtrace": null
         }
     ]
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json

@@ -115,5 +115,50 @@
             "id": "^ZERO_CHECK::@53632cba2752272bb008$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": 6,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": [
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": 6,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 69 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json

@@ -152,6 +152,75 @@
             "backtrace": null
         }
     ],
+    "linkLibraries": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 14,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": [
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 14,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null,
     "debugger": {
         "workingDirectory": "^/test/debugger/workingDirectory$"
     }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json

@@ -276,5 +276,11 @@
       "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
       "backtrace": null
     }
-  ]
+  ],
+  "linkLibraries": null,
+  "interfaceLinkLibraries": null,
+  "compileDependencies": null,
+  "interfaceCompileDependencies": null,
+  "objectDependencies": null,
+  "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json

@@ -122,5 +122,11 @@
       "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
       "backtrace": null
     }
-  ]
+  ],
+  "linkLibraries": null,
+  "interfaceLinkLibraries": null,
+  "compileDependencies": null,
+  "interfaceCompileDependencies": null,
+  "objectDependencies": null,
+  "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json

@@ -116,5 +116,11 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json

@@ -163,5 +163,50 @@
             "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": 10,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+            "backtrace": [
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": 10,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json

@@ -90,5 +90,11 @@
             "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 70 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json

@@ -151,5 +151,74 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 19,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": [
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 19,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 10 - 4
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json

@@ -130,7 +130,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 54,
+                        "line": 55,
                         "command": "install",
                         "hasParent": true
                     },
@@ -160,7 +160,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 54,
+                        "line": 55,
                         "command": "install",
                         "hasParent": true
                     },
@@ -190,7 +190,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 59,
+                        "line": 60,
                         "command": "install",
                         "hasParent": true
                     },
@@ -227,5 +227,11 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 70 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json

@@ -151,5 +151,74 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 23,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": [
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 23,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json

@@ -116,5 +116,11 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 66 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json

@@ -157,5 +157,70 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^subdir/CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^subdir/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^subdir/CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^subdir/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "compileDependencies": [
+        {
+            "id": "^c_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": [
+                {
+                    "file": "^subdir/CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^subdir/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 127 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/compile_usage_exe.json

@@ -0,0 +1,127 @@
+{
+    "name": "compile_usage_exe",
+    "id": "^compile_usage_exe::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "EXECUTABLE",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^empty\\.c$",
+            "isGenerated": null,
+            "fileSetName": null,
+            "sourceGroupName": "Source Files",
+            "compileGroupLanguage": "C",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 38,
+                    "command": "add_executable",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "Source Files",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ]
+        }
+    ],
+    "compileGroups": [
+        {
+            "language": "C",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ],
+            "includes": null,
+            "frameworks": null,
+            "defines": [
+                {
+                    "define": "_MBCS",
+                    "backtrace": null
+                }
+            ],
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 38,
+            "command": "add_executable",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": "^compile_usage_exe(\\.exe)?$",
+    "artifacts": [
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?compile_usage_exe(\\.exe)?$",
+            "_dllExtra": false
+        },
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?compile_usage_exe\\.pdb$",
+            "_dllExtra": true
+        }
+    ],
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": {
+        "language": "C",
+        "lto": null,
+        "commandFragments": null
+    },
+    "archive": null,
+    "dependencies": [
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 40,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 24 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json

@@ -115,5 +115,29 @@
             "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
             "backtrace": null
         }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": [
+        {
+            "id": "^custom_tgt::@c11385ffed57b860da63$",
+            "backtrace": [
+                {
+                    "file": "^custom/CMakeLists\\.txt$",
+                    "line": 5,
+                    "command": "add_dependencies",
+                    "hasParent": true
+                },
+                {
+                    "file": "^custom/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
     ]
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json

@@ -90,5 +90,11 @@
             "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json

@@ -115,5 +115,50 @@
             "id": "^ZERO_CHECK::@53632cba2752272bb008$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": 10,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": [
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": 10,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^alias/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json

@@ -148,7 +148,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 51,
+                        "line": 52,
                         "command": "install",
                         "hasParent": true
                     },
@@ -258,6 +258,51 @@
             "backtrace": null
         }
     ],
+    "linkLibraries": [
+        {
+            "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": 6,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": [
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": 6,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null,
     "debugger": {
         "workingDirectory": "^/test/debugger/workingDirectory$"
     }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json

@@ -104,5 +104,11 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json

@@ -108,5 +108,11 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json

@@ -104,5 +104,11 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json

@@ -108,5 +108,11 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json

@@ -92,5 +92,11 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json

@@ -163,5 +163,50 @@
             "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": 14,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+            "backtrace": [
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": 14,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^object/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json

@@ -90,5 +90,11 @@
             "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json

@@ -115,5 +115,50 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": 13,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies":  [
+        {
+            "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": [
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": 13,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 10 - 4
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json

@@ -106,7 +106,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 54,
+                        "line": 55,
                         "command": "install",
                         "hasParent": true
                     },
@@ -136,7 +136,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 54,
+                        "line": 55,
                         "command": "install",
                         "hasParent": true
                     },
@@ -166,7 +166,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 59,
+                        "line": 60,
                         "command": "install",
                         "hasParent": true
                     },
@@ -203,5 +203,11 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json

@@ -117,5 +117,11 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json

@@ -117,5 +117,11 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json

@@ -115,5 +115,50 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+            "backtrace": [
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^cxx/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json

@@ -92,5 +92,11 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 120 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json

@@ -169,5 +169,124 @@
             "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^import_framework::@217a96c3a62328a73ef4$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        },
+        {
+            "id": "^shared_framework::@217a96c3a62328a73ef4$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        },
+        {
+            "id": "^static_framework::@217a96c3a62328a73ef4$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^import_framework::@217a96c3a62328a73ef4$",
+            "backtrace": [
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        },
+        {
+            "id": "^shared_framework::@217a96c3a62328a73ef4$",
+            "backtrace": [
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        },
+        {
+            "id": "^static_framework::@217a96c3a62328a73ef4$",
+            "backtrace": [
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": 17,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^framework/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json

@@ -316,5 +316,11 @@
             "id": "^ZERO_CHECK::@[0-9a-f]+$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_none.json

@@ -35,5 +35,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json

@@ -69,5 +69,11 @@
             "id": "^ZERO_CHECK::@25b7fa8ea00134654b85$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_symbolic.json

@@ -35,5 +35,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/import_framework.json

@@ -44,5 +44,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_exe.json

@@ -40,5 +40,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_lib.json

@@ -35,5 +35,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_symbolic_lib.json

@@ -35,5 +35,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_lib.json

@@ -35,5 +35,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_object_lib.json

@@ -35,5 +35,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_shared_lib.json

@@ -44,5 +44,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_static_lib.json

@@ -40,5 +40,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 45 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/inject_direct_lib.json

@@ -0,0 +1,45 @@
+{
+    "name": "inject_direct_lib",
+    "id": "^inject_direct_lib::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "INTERFACE_LIBRARY",
+    "imported": null,
+    "local": null,
+    "abstract": true,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [],
+    "sourceGroups": null,
+    "compileGroups": null,
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 5,
+            "command": "add_library",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": null,
+    "artifacts": null,
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": null,
+    "archive": null,
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 100 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/inject_direct_lib_impl.json

@@ -0,0 +1,100 @@
+{
+    "name": "inject_direct_lib_impl",
+    "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "OBJECT_LIBRARY",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^direct/other\\.c$",
+            "isGenerated": null,
+            "fileSetName": null,
+            "sourceGroupName": "Source Files",
+            "compileGroupLanguage": "C",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 6,
+                    "command": "add_library",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "Source Files",
+            "sourcePaths": [
+                "^direct/other\\.c$"
+            ]
+        }
+    ],
+    "compileGroups": [
+        {
+            "language": "C",
+            "sourcePaths": [
+                "^direct/other\\.c$"
+            ],
+            "includes": null,
+            "frameworks": null,
+            "defines": [
+                {
+                    "define": "_MBCS",
+                    "backtrace": null
+                }
+            ],
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 6,
+            "command": "add_library",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": null,
+    "artifacts": [
+        {
+            "path": "^(direct|build/inject_direct_lib_impl\\.build)/.*/other(\\.c)?\\.o(bj)?$",
+            "_dllExtra": false
+        }
+    ],
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": null,
+    "archive": null,
+    "dependencies": [
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 94 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json

@@ -200,5 +200,98 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^interface_lib::@6890427a1f51a3e7e1df$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^include_test\\.cmake$",
+                    "line": 4,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^include_test\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 10,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^interface_lib::@6890427a1f51a3e7e1df$",
+            "backtrace": [
+                {
+                    "file": "^include_test\\.cmake$",
+                    "line": 4,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^include_test\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": 10,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^codemodel-v2\\.cmake$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "include",
+                    "hasParent": true
+                },
+                {
+                    "file": "^CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_lib.json

@@ -59,5 +59,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json

@@ -98,5 +98,50 @@
             "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^imported_lib::@ba7eb709d0b48779c6c8$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 10,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^imported_lib::@ba7eb709d0b48779c6c8$",
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 10,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json

@@ -98,5 +98,50 @@
             "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^imported_interface_lib::@ba7eb709d0b48779c6c8$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 33,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^imported_interface_lib::@ba7eb709d0b48779c6c8$",
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 33,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_symbolic_exe.json

@@ -98,5 +98,50 @@
             "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^imported_interface_symbolic_lib::@ba7eb709d0b48779c6c8$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 37,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^imported_interface_symbolic_lib::@ba7eb709d0b48779c6c8$",
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 37,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json

@@ -98,5 +98,50 @@
             "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^imported_object_lib::@ba7eb709d0b48779c6c8$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^imported_object_lib::@ba7eb709d0b48779c6c8$",
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json

@@ -98,5 +98,50 @@
             "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^imported_shared_lib::@ba7eb709d0b48779c6c8$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 18,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^imported_shared_lib::@ba7eb709d0b48779c6c8$",
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 18,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 46 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json

@@ -98,5 +98,50 @@
             "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": [
+        {
+            "id": "^imported_static_lib::@ba7eb709d0b48779c6c8$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 23,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^imported_static_lib::@ba7eb709d0b48779c6c8$",
+            "backtrace": [
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": 23,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 245 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_transitive_direct_exe.json

@@ -0,0 +1,245 @@
+{
+    "name": "link_transitive_direct_exe",
+    "id": "^link_transitive_direct_exe::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "EXECUTABLE",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^empty\\.c$",
+            "isGenerated": null,
+            "fileSetName": null,
+            "sourceGroupName": "Source Files",
+            "compileGroupLanguage": "C",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 3,
+                    "command": "add_executable",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(direct|build/inject_direct_lib_impl\\.build)/.*/other(\\.c)?\\.o(bj)?$",
+            "isGenerated": true,
+            "fileSetName": null,
+            "sourceGroupName": "Object Libraries",
+            "compileGroupLanguage": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 13,
+                    "command": "set_property",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "Source Files",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ]
+        },
+        {
+            "name": "Object Libraries",
+            "sourcePaths": [
+                "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(direct|build/inject_direct_lib_impl\\.build)/.*/other(\\.c)?\\.o(bj)?$"
+            ]
+        }
+    ],
+    "compileGroups": [
+        {
+            "language": "C",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ],
+            "includes": null,
+            "frameworks": null,
+            "defines": [
+                {
+                    "define": "_MBCS",
+                    "backtrace": null
+                }
+            ],
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 3,
+            "command": "add_executable",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": "^link_transitive_direct_exe(\\.exe)?$",
+    "artifacts": [
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_transitive_direct_exe(\\.exe)?$",
+            "_dllExtra": false
+        },
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_transitive_direct_exe\\.pdb$",
+            "_dllExtra": true
+        }
+    ],
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": {
+        "language": "C",
+        "lto": null,
+        "commandFragments": null
+    },
+    "archive": null,
+    "dependencies": [
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 18,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 13,
+                    "command": "set_property",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": [
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 18,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 13,
+                    "command": "set_property",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": "^inject_direct_lib::@79b6367c9e05c77f6a80$"
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": [
+        {
+            "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 18,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        },
+        {
+            "id": "^inject_direct_lib_impl::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 13,
+                    "command": "set_property",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": "^inject_direct_lib::@79b6367c9e05c77f6a80$"
+        }
+    ],
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 145 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_usage_exe.json

@@ -0,0 +1,145 @@
+{
+    "name": "link_usage_exe",
+    "id": "^link_usage_exe::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "EXECUTABLE",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^empty\\.c$",
+            "isGenerated": null,
+            "fileSetName": null,
+            "sourceGroupName": "Source Files",
+            "compileGroupLanguage": "C",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 37,
+                    "command": "add_executable",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "Source Files",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ]
+        }
+    ],
+    "compileGroups": [
+        {
+            "language": "C",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ],
+            "includes": null,
+            "frameworks": null,
+            "defines": [
+                {
+                    "define": "_MBCS",
+                    "backtrace": null
+                }
+            ],
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 37,
+            "command": "add_executable",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": "^link_usage_exe(\\.exe)?$",
+    "artifacts": [
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_usage_exe(\\.exe)?$",
+            "_dllExtra": false
+        },
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_usage_exe\\.pdb$",
+            "_dllExtra": true
+        }
+    ],
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": {
+        "language": "C",
+        "lto": null,
+        "commandFragments": null
+    },
+    "archive": null,
+    "dependencies": [
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 39,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": [
+        {
+            "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 39,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json

@@ -110,5 +110,11 @@
             "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json

@@ -92,5 +92,11 @@
             "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$",
             "backtrace": null
         }
-    ]
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 196 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/transitive_direct_lib.json

@@ -0,0 +1,196 @@
+{
+    "name": "transitive_direct_lib",
+    "id": "^transitive_direct_lib::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "STATIC_LIBRARY",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^empty\\.c$",
+            "isGenerated": null,
+            "fileSetName": null,
+            "sourceGroupName": "Source Files",
+            "compileGroupLanguage": "C",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 4,
+                    "command": "add_library",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "Source Files",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ]
+        }
+    ],
+    "compileGroups": [
+        {
+            "language": "C",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ],
+            "includes": null,
+            "frameworks": null,
+            "defines": [
+                {
+                    "define": "_MBCS",
+                    "backtrace": null
+                }
+            ],
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 4,
+            "command": "add_library",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": "^(lib)?transitive_direct_lib\\.(a|lib|l)$",
+    "artifacts": [
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?transitive_direct_lib\\.(a|lib|l)$",
+            "_dllExtra": false
+        }
+    ],
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": null,
+    "archive": {
+        "lto": null
+    },
+    "dependencies": [
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": [
+        {
+            "id": "^inject_direct_lib::@79b6367c9e05c77f6a80$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceLinkLibraries": [
+        {
+            "id": "^inject_direct_lib::@79b6367c9e05c77f6a80$",
+            "fragment": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "id": null,
+            "fragment": "-lm",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "compileDependencies": [
+        {
+            "id": "^inject_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ],
+            "fromDependency": null
+        }
+    ],
+    "interfaceCompileDependencies": [
+        {
+            "id": "^inject_direct_lib::@79b6367c9e05c77f6a80$",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 28,
+                    "command": "target_link_libraries",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 102 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/usage_lib.json

@@ -0,0 +1,102 @@
+{
+    "name": "usage_lib",
+    "id": "^usage_lib::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "STATIC_LIBRARY",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^empty\\.c$",
+            "isGenerated": null,
+            "fileSetName": null,
+            "sourceGroupName": "Source Files",
+            "compileGroupLanguage": "C",
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": 36,
+                    "command": "add_library",
+                    "hasParent": true
+                },
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "Source Files",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ]
+        }
+    ],
+    "compileGroups": [
+        {
+            "language": "C",
+            "sourcePaths": [
+                "^empty\\.c$"
+            ],
+            "includes": null,
+            "frameworks": null,
+            "defines": [
+                {
+                    "define": "_MBCS",
+                    "backtrace": null
+                }
+            ],
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": 36,
+            "command": "add_library",
+            "hasParent": true
+        },
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": "^(lib)?usage_lib\\.(a|lib|l)$",
+    "artifacts": [
+        {
+            "path": "^direct/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?usage_lib\\.(a|lib|l)$",
+            "_dllExtra": false
+        }
+    ],
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": null,
+    "archive": {
+        "lto": null
+    },
+    "dependencies": [
+        {
+            "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+            "backtrace": null
+        }
+    ],
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json

@@ -73,5 +73,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json

@@ -73,5 +73,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json

@@ -73,5 +73,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 83 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_direct.json

@@ -0,0 +1,83 @@
+{
+    "name": "ZERO_CHECK",
+    "id": "^ZERO_CHECK::@79b6367c9e05c77f6a80$",
+    "directorySource": "^direct$",
+    "projectName": "Direct",
+    "type": "UTILITY",
+    "imported": null,
+    "local": null,
+    "abstract": null,
+    "symbolic": null,
+    "isGeneratorProvided": true,
+    "fileSets": null,
+    "sources": [
+        {
+            "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ZERO_CHECK$",
+            "isGenerated": true,
+            "fileSetName": null,
+            "sourceGroupName": "",
+            "compileGroupLanguage": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        },
+        {
+            "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ZERO_CHECK\\.rule$",
+            "isGenerated": true,
+            "fileSetName": null,
+            "sourceGroupName": "CMake Rules",
+            "compileGroupLanguage": null,
+            "backtrace": [
+                {
+                    "file": "^direct/CMakeLists\\.txt$",
+                    "line": null,
+                    "command": null,
+                    "hasParent": false
+                }
+            ]
+        }
+    ],
+    "sourceGroups": [
+        {
+            "name": "",
+            "sourcePaths": [
+                "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ZERO_CHECK$"
+            ]
+        },
+        {
+            "name": "CMake Rules",
+            "sourcePaths": [
+                "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/direct/CMakeFiles/ZERO_CHECK\\.rule$"
+            ]
+        }
+    ],
+    "compileGroups": null,
+    "backtrace": [
+        {
+            "file": "^direct/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": null,
+    "artifacts": null,
+    "build": "^direct$",
+    "source": "^direct$",
+    "install": null,
+    "link": null,
+    "archive": null,
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
+}

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json

@@ -73,5 +73,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

+ 7 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json

@@ -73,5 +73,11 @@
     "install": null,
     "link": null,
     "archive": null,
-    "dependencies": null
+    "dependencies": null,
+    "linkLibraries": null,
+    "interfaceLinkLibraries": null,
+    "compileDependencies": null,
+    "interfaceCompileDependencies": null,
+    "objectDependencies": null,
+    "orderDependencies": null
 }

Some files were not shown because too many files changed in this diff