浏览代码

Merge topic 'cps-symbolic-info'

62a1d3e7f1 FileAPI: Add symbolic property to targets
d92b6c3e20 CPS: Add Symbolic Components
03284e018f Help: Simplify file-api version information for "abstract" field

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !11132
Brad King 2 周之前
父节点
当前提交
0d01bc72b8
共有 100 个文件被更改,包括 479 次插入14 次删除
  1. 24 0
      Help/command/add_library.rst
  2. 10 1
      Help/manual/cmake-file-api.7.rst
  3. 1 0
      Help/manual/cmake-properties.7.rst
  4. 7 0
      Help/manual/file_api/schema_target.json
  5. 11 0
      Help/prop_tgt/SYMBOLIC.rst
  6. 17 5
      Source/cmAddLibraryCommand.cxx
  7. 14 1
      Source/cmExportCMakeConfigGenerator.cxx
  8. 2 1
      Source/cmExportPackageInfoGenerator.cxx
  9. 3 0
      Source/cmFileAPICodemodel.cxx
  10. 5 0
      Source/cmGeneratorTarget.cxx
  11. 1 0
      Source/cmGeneratorTarget.h
  12. 3 1
      Source/cmPackageInfoReader.cxx
  13. 6 0
      Source/cmSetPropertyCommand.cxx
  14. 4 0
      Source/cmSetTargetPropertiesCommand.cxx
  15. 19 0
      Source/cmTarget.cxx
  16. 3 0
      Source/cmTarget.h
  17. 5 0
      Source/cmTargetLinkLibrariesCommand.cxx
  18. 4 0
      Source/cmTargetPropCommandBase.cxx
  19. 5 0
      Tests/RunCMake/ExportImport/InterfaceWithSymbolic-export.cmake
  20. 6 0
      Tests/RunCMake/ExportImport/InterfaceWithSymbolic-import.cmake
  21. 3 0
      Tests/RunCMake/ExportImport/RunCMakeTest.cmake
  22. 7 0
      Tests/RunCMake/ExportPackageInfo/ExportSymbolicComponent-check.cmake
  23. 4 0
      Tests/RunCMake/ExportPackageInfo/ExportSymbolicComponent.cmake
  24. 2 0
      Tests/RunCMake/ExportPackageInfo/RunCMakeTest.cmake
  25. 16 0
      Tests/RunCMake/ExportPackageInfo/TransitiveSymbolicComponent-check.cmake
  26. 14 0
      Tests/RunCMake/ExportPackageInfo/TransitiveSymbolicComponent.cmake
  27. 17 0
      Tests/RunCMake/ExportPackageInfo/cps/symbolic.cps
  28. 7 0
      Tests/RunCMake/FileAPI/codemodel-v2-check.py
  29. 4 2
      Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json
  30. 2 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/directories/interface.json
  31. 3 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json
  32. 2 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/projects/interface.json
  33. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json
  34. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json
  35. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
  36. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json
  37. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json
  38. 5 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json
  39. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json
  40. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json
  41. 5 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
  42. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json
  43. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
  44. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json
  45. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json
  46. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json
  47. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json
  48. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json
  49. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
  50. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
  51. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
  52. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
  53. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json
  54. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json
  55. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
  56. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json
  57. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
  58. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json
  59. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json
  60. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json
  61. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json
  62. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json
  63. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json
  64. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json
  65. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
  66. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
  67. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
  68. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
  69. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
  70. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
  71. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json
  72. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json
  73. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_none.json
  74. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json
  75. 39 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_symbolic.json
  76. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/import_framework.json
  77. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_exe.json
  78. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_lib.json
  79. 39 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_symbolic_lib.json
  80. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_lib.json
  81. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_object_lib.json
  82. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_shared_lib.json
  83. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_static_lib.json
  84. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json
  85. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_lib.json
  86. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json
  87. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json
  88. 97 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_symbolic_exe.json
  89. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json
  90. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json
  91. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json
  92. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json
  93. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json
  94. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json
  95. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json
  96. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json
  97. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json
  98. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json
  99. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json
  100. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json

+ 24 - 0
Help/command/add_library.rst

@@ -196,6 +196,30 @@ Interface Libraries
     call are ``PRIVATE`` to the interface library and do not appear in its
     :prop_tgt:`INTERFACE_SOURCES` target property.
 
+.. signature::
+  add_library(<name> INTERFACE SYMBOLIC)
+  :target: INTERFACE-SYMBOLIC
+
+  .. versionadded:: 4.2
+
+  Add a symbolic :ref:`Interface Library <Interface Libraries>` target.
+  Symbolic interface libraries are useful for representing optional components
+  or features in a package.  They have no usage requirements, do not compile
+  sources, and do not produce a library artifact on disk, but they may be
+  exported and installed.  They can also be tested for existence with the
+  regular :command:`if(TARGET)` subcommand.
+
+  A symbolic interface library may be used as a linkable target to enforce the
+  presence of optional components in a dependency.  For example, if a library
+  ``libgui`` may or may not provide a feature ``widget``, a consumer package
+  can link against ``widget`` to express that it requires this component to be
+  available.  This allows :command:`find_package` calls that declare required
+  components to be validated by linking against the corresponding symbolic
+  targets.
+
+  A symbolic interface library has the :prop_tgt:`SYMBOLIC` target property
+  set to true.
+
 .. _`add_library imported libraries`:
 
 Imported Libraries

+ 10 - 1
Help/manual/cmake-file-api.7.rst

@@ -1132,7 +1132,16 @@ with members:
   target.
 
   This field was added in codemodel version 2.9.  Abstract targets were not
-  included anywhere in file API replies in codemodel version 2.8 and earlier.
+  included in codemodel version 2.8 and earlier.
+
+``symbolic``
+  Optional member that is present with boolean value ``true`` if the target
+  is :prop_tgt:`SYMBOLIC`.  Symbolic targets are created by calls to
+  :command:`add_library(INTERFACE SYMBOLIC) <add_library(INTERFACE-SYMBOLIC)>`,
+  and are also abstract targets that are not part of the build system.
+
+  This field was added in codemodel version 2.9.  Symbolic targets were not
+  included in codemodel version 2.8 and earlier.
 
 ``backtrace``
   Optional member that is present when a CMake language backtrace to

+ 1 - 0
Help/manual/cmake-properties.7.rst

@@ -417,6 +417,7 @@ Properties on Targets
    /prop_tgt/Swift_LANGUAGE_VERSION
    /prop_tgt/Swift_MODULE_DIRECTORY
    /prop_tgt/Swift_MODULE_NAME
+   /prop_tgt/SYMBOLIC
    /prop_tgt/SYSTEM
    /prop_tgt/TEST_LAUNCHER
    /prop_tgt/TRANSITIVE_COMPILE_PROPERTIES

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

@@ -93,6 +93,10 @@
       "type": "boolean",
       "description": "True if the target is defined in a local scope rather than being a global target"
     },
+    "symbolicV2_9": {
+      "type": "boolean",
+      "description": "True if an interface target has the SYMBOLIC property set"
+    },
     "abstractV2_9": {
       "type": "boolean",
       "description": "True if the target is not part of the build system"
@@ -1416,6 +1420,9 @@
         "sources": {
           "$ref": "#/definitions/sourcesV2_5"
         },
+        "symbolic": {
+          "$ref": "#/definitions/symbolicV2_9"
+        },
         "sourceGroups": {
           "$ref": "#/definitions/sourceGroups"
         },

+ 11 - 0
Help/prop_tgt/SYMBOLIC.rst

@@ -0,0 +1,11 @@
+SYMBOLIC
+--------
+
+.. versionadded:: 4.2
+
+Read-only indication of whether a target is ``SYMBOLIC``.
+
+Symbolic targets are created by calls to
+:command:`add_library(INTERFACE SYMBOLIC) <add_library(INTERFACE-SYMBOLIC)>`.
+They are useful for packages to represent additional **components** or
+**feature selectors** that consumers can request via ``find_package()``.

+ 17 - 5
Source/cmAddLibraryCommand.cxx

@@ -33,6 +33,7 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
   bool excludeFromAll = false;
   bool importTarget = false;
   bool importGlobal = false;
+  bool symbolicTarget = false;
 
   auto s = args.begin();
 
@@ -117,6 +118,9 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
     } else if (*s == "EXCLUDE_FROM_ALL") {
       ++s;
       excludeFromAll = true;
+    } else if (*s == "SYMBOLIC") {
+      ++s;
+      symbolicTarget = true;
     } else if (*s == "IMPORTED") {
       ++s;
       importTarget = true;
@@ -223,9 +227,9 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
   }
 
   /* ideally we should check whether for the linker language of the target
-    CMAKE_${LANG}_CREATE_SHARED_LIBRARY is defined and if not default to
-    STATIC. But at this point we know only the name of the target, but not
-    yet its linker language. */
+     CMAKE_${LANG}_CREATE_SHARED_LIBRARY is defined and if not default to
+     STATIC. But at this point we know only the name of the target, but not
+     yet its linker language. */
   if ((type == cmStateEnums::SHARED_LIBRARY ||
        type == cmStateEnums::MODULE_LIBRARY) &&
       !mf.GetState()->GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS")) {
@@ -282,7 +286,8 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
     }
 
     // Create the imported target.
-    mf.AddImportedTarget(libName, type, importGlobal);
+    cmTarget* target = mf.AddImportedTarget(libName, type, importGlobal);
+    target->SetSymbolic(symbolicTarget);
     return true;
   }
 
@@ -312,8 +317,15 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
     }
   }
 
+  if (symbolicTarget && type != cmStateEnums::INTERFACE_LIBRARY) {
+    status.SetError(
+      "SYMBOLIC option may only be used with INTERFACE libraries");
+    return false;
+  }
+
   std::vector<std::string> srcs(s, args.end());
-  mf.AddLibrary(libName, type, srcs, excludeFromAll);
+  cmTarget* target = mf.AddLibrary(libName, type, srcs, excludeFromAll);
+  target->SetSymbolic(symbolicTarget);
 
   return true;
 }

+ 14 - 1
Source/cmExportCMakeConfigGenerator.cxx

@@ -292,7 +292,20 @@ void cmExportCMakeConfigGenerator::GenerateImportTargetCode(
       os << "add_library(" << targetName << " OBJECT IMPORTED)\n";
       break;
     case cmStateEnums::INTERFACE_LIBRARY:
-      os << "add_library(" << targetName << " INTERFACE IMPORTED)\n";
+      if (target->IsSymbolic()) {
+        os << "if(CMAKE_VERSION VERSION_GREATER_EQUAL \""
+           << CMake_VERSION_DEVEL(4, 2)
+           << "\")\n"
+              "  add_library("
+           << targetName << " INTERFACE SYMBOLIC IMPORTED)\n"
+           << "elseif(CMAKE_VERSION VERSION_GREATER_EQUAL 3.2.0)\n"
+           << "  add_library(" << targetName << " INTERFACE IMPORTED)\n"
+           << "  set_target_properties(" << targetName
+           << " PROPERTIES SYMBOLIC TRUE)\n"
+           << "endif()\n";
+      } else {
+        os << "add_library(" << targetName << " INTERFACE IMPORTED)\n";
+      }
       break;
     default: // should never happen
       break;

+ 2 - 1
Source/cmExportPackageInfoGenerator.cxx

@@ -182,6 +182,7 @@ Json::Value* cmExportPackageInfoGenerator::GenerateImportTarget(
 
   Json::Value& component = components[name];
   Json::Value& type = component["type"];
+
   switch (targetType) {
     case cmStateEnums::EXECUTABLE:
       type = "executable";
@@ -196,7 +197,7 @@ Json::Value* cmExportPackageInfoGenerator::GenerateImportTarget(
       type = "module";
       break;
     case cmStateEnums::INTERFACE_LIBRARY:
-      type = "interface";
+      type = target->IsSymbolic() ? "symbolic" : "interface";
       break;
     default:
       type = "unknown";

+ 3 - 0
Source/cmFileAPICodemodel.cxx

@@ -1269,6 +1269,9 @@ Json::Value Target::Dump()
       target["local"] = true;
     }
   }
+  if (this->GT->IsSymbolic()) {
+    target["symbolic"] = true;
+  }
   if (!this->GT->IsInBuildSystem()) {
     target["abstract"] = true;
   }

+ 5 - 0
Source/cmGeneratorTarget.cxx

@@ -1153,6 +1153,11 @@ bool cmGeneratorTarget::IsImportedGloballyVisible() const
   return this->Target->IsImportedGloballyVisible();
 }
 
+bool cmGeneratorTarget::IsSymbolic() const
+{
+  return this->Target->IsSymbolic();
+}
+
 bool cmGeneratorTarget::IsForeign() const
 {
   return this->Target->IsForeign();

+ 1 - 0
Source/cmGeneratorTarget.h

@@ -70,6 +70,7 @@ public:
   bool IsImported() const;
   bool IsImportedGloballyVisible() const;
   bool IsForeign() const;
+  bool IsSymbolic() const;
   bool CanCompileSources() const;
   bool HasKnownRuntimeArtifactLocation(std::string const& config) const;
   std::string const& GetLocation(std::string const& config) const;

+ 3 - 1
Source/cmPackageInfoReader.cxx

@@ -773,7 +773,9 @@ bool cmPackageInfoReader::ImportTargets(cmMakefile* makefile,
 
     cmTarget* target = nullptr;
     if (type == "symbolic"_s) {
-      // TODO
+      target = this->AddLibraryComponent(
+        makefile, cmStateEnums::INTERFACE_LIBRARY, fullName, *ci, package);
+      target->SetSymbolic(true);
     } else if (type == "dylib"_s) {
       target = this->AddLibraryComponent(
         makefile, cmStateEnums::SHARED_LIBRARY, fullName, *ci, package);

+ 6 - 0
Source/cmSetPropertyCommand.cxx

@@ -634,7 +634,13 @@ bool HandleTargetMode(cmExecutionStatus& status,
       status.SetError("can not be used on an ALIAS target.");
       return false;
     }
+
     if (cmTarget* target = status.GetMakefile().FindTargetToUse(name)) {
+      if (target->IsSymbolic()) {
+        status.SetError("can not be used on a SYMBOLIC target.");
+        return false;
+      }
+
       // Handle the current target.
       if (!HandleTarget(target, status.GetMakefile(), propertyName,
                         propertyValue, appendAsString, appendMode, remove)) {

+ 4 - 0
Source/cmSetTargetPropertiesCommand.cxx

@@ -40,6 +40,10 @@ bool cmSetTargetPropertiesCommand(std::vector<std::string> const& args,
       return false;
     }
     if (cmTarget* target = mf.FindTargetToUse(tname)) {
+      if (target->IsSymbolic()) {
+        status.SetError("can not be used on a SYMBOLIC target.");
+        return false;
+      }
       // loop through all the props and set them
       for (auto k = propsIter + 1; k != args.end(); k += 2) {
         target->SetProperty(*k, *(k + 1));

+ 19 - 0
Source/cmTarget.cxx

@@ -608,6 +608,7 @@ public:
   bool IsAndroid;
   bool BuildInterfaceIncludesAppended;
   bool PerConfig;
+  bool IsSymbolic;
   cmTarget::Visibility TargetVisibility;
   std::set<BT<std::pair<std::string, bool>>> Utilities;
   std::set<std::string> CodegenDependencies;
@@ -885,6 +886,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
   this->impl->IsAIX = false;
   this->impl->IsApple = false;
   this->impl->IsAndroid = false;
+  this->impl->IsSymbolic = false;
   this->impl->TargetVisibility = vis;
   this->impl->BuildInterfaceIncludesAppended = false;
   this->impl->PerConfig = (perConfig == PerConfig::Yes);
@@ -1946,6 +1948,7 @@ MAKE_PROP(LINK_LIBRARIES);
 MAKE_PROP(MANUALLY_ADDED_DEPENDENCIES);
 MAKE_PROP(NAME);
 MAKE_PROP(SOURCES);
+MAKE_PROP(SYMBOLIC);
 MAKE_PROP(TYPE);
 MAKE_PROP(BINARY_DIR);
 MAKE_PROP(SOURCE_DIR);
@@ -2047,6 +2050,7 @@ bool IsSettableProperty(cmMakefile* context, cmTarget* target,
     { "MANUALLY_ADDED_DEPENDENCIES", { ROC::All } },
     { "NAME", { ROC::All } },
     { "SOURCES", { ROC::Imported } },
+    { "SYMBOLIC", { ROC::All } },
     { "TYPE", { ROC::All } },
     { "ALIAS_GLOBAL", { ROC::All, cmPolicies::CMP0160 } },
     { "BINARY_DIR", { ROC::All, cmPolicies::CMP0160 } },
@@ -2067,6 +2071,11 @@ bool IsSettableProperty(cmMakefile* context, cmTarget* target,
 }
 }
 
+void cmTarget::SetSymbolic(bool const value)
+{
+  this->impl->IsSymbolic = value;
+}
+
 void cmTarget::SetProperty(std::string const& prop, cmValue value)
 {
   if (!IsSettableProperty(this->impl->Makefile, this, prop)) {
@@ -2606,6 +2615,7 @@ cmValue cmTarget::GetProperty(std::string const& prop) const
     propBINARY_DIR,
     propSOURCE_DIR,
     propSOURCES,
+    propSYMBOLIC,
     propINTERFACE_LINK_LIBRARIES,
     propINTERFACE_LINK_LIBRARIES_DIRECT,
     propINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE,
@@ -2626,6 +2636,10 @@ cmValue cmTarget::GetProperty(std::string const& prop) const
       return cmValue(propertyIter->second.Value);
     }
 
+    if (prop == propSYMBOLIC) {
+      return this->IsSymbolic() ? cmValue(propTRUE) : cmValue(propFALSE);
+    }
+
     UsageRequirementProperty const* usageRequirements[] = {
       &this->impl->IncludeDirectories,
       &this->impl->CompileOptions,
@@ -2760,6 +2774,11 @@ bool cmTarget::IsApple() const
   return this->impl->IsApple;
 }
 
+bool cmTarget::IsSymbolic() const
+{
+  return this->impl->IsSymbolic;
+}
+
 bool cmTarget::IsNormal() const
 {
   switch (this->impl->TargetVisibility) {

+ 3 - 0
Source/cmTarget.h

@@ -193,6 +193,8 @@ public:
   //! Get the utilities used by this target
   std::set<BT<std::pair<std::string, bool>>> const& GetUtilities() const;
 
+  void SetSymbolic(bool value);
+
   //! Set/Get a property of this target file
   void SetProperty(std::string const& prop, cmValue value);
   void SetProperty(std::string const& prop, std::nullptr_t)
@@ -232,6 +234,7 @@ public:
   bool IsForeign() const;
   bool IsPerConfig() const;
   bool IsRuntimeBinary() const;
+  bool IsSymbolic() const;
   bool CanCompileSources() const;
 
   bool GetMappedConfig(std::string const& desiredConfig, cmValue& loc,

+ 5 - 0
Source/cmTargetLinkLibrariesCommand.cxx

@@ -102,6 +102,11 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
     return true;
   }
 
+  if (target->IsSymbolic()) {
+    status.SetError("can not be used on a SYMBOLIC target.");
+    return false;
+  }
+
   // Having a UTILITY library on the LHS is a bug.
   if (target->GetType() == cmStateEnums::UTILITY) {
     mf.IssueMessage(

+ 4 - 0
Source/cmTargetPropCommandBase.cxx

@@ -42,6 +42,10 @@ bool cmTargetPropCommandBase::HandleArguments(
     this->HandleMissingTarget(args[0]);
     return false;
   }
+  if (this->Target->IsSymbolic()) {
+    this->SetError("can not be used on a SYMBOLIC target.");
+    return false;
+  }
   bool const isRegularTarget =
     (this->Target->GetType() == cmStateEnums::EXECUTABLE) ||
     (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) ||

+ 5 - 0
Tests/RunCMake/ExportImport/InterfaceWithSymbolic-export.cmake

@@ -0,0 +1,5 @@
+add_library(gui INTERFACE)
+add_library(widget INTERFACE SYMBOLIC)
+
+install(TARGETS gui widget EXPORT gui-targets)
+install(EXPORT gui-targets DESTINATION lib/cmake/gui FILE gui-config.cmake NAMESPACE gui::)

+ 6 - 0
Tests/RunCMake/ExportImport/InterfaceWithSymbolic-import.cmake

@@ -0,0 +1,6 @@
+enable_language(C)
+find_package(gui REQUIRED)
+
+add_library(baz INTERFACE)
+
+target_link_libraries(baz INTERFACE gui::gui gui::widget)

+ 3 - 0
Tests/RunCMake/ExportImport/RunCMakeTest.cmake

@@ -18,11 +18,14 @@ function(run_ExportImport_test case)
   run_cmake_with_options(${case}-import
     -Dfoo_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/foo
     -Dbar_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/bar
+    -Dgui_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/gui
     )
 endfunction()
 
 run_ExportImport_test(SharedDep)
 run_ExportImport_test(SpdxLicenseProperty)
+run_ExportImport_test(InterfaceWithSymbolic)
+
 
 function(run_ExportImportBuildInstall_test case)
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-export-build)

+ 7 - 0
Tests/RunCMake/ExportPackageInfo/ExportSymbolicComponent-check.cmake

@@ -0,0 +1,7 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/ExportSymbolicComponent-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "symbolic" "components" "foo" "type")

+ 4 - 0
Tests/RunCMake/ExportPackageInfo/ExportSymbolicComponent.cmake

@@ -0,0 +1,4 @@
+add_library(foo INTERFACE SYMBOLIC)
+
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)

+ 2 - 0
Tests/RunCMake/ExportPackageInfo/RunCMakeTest.cmake

@@ -38,6 +38,7 @@ run_cmake(Minimal)
 run_cmake(MinimalVersion)
 run_cmake(LowerCaseFile)
 run_cmake(Requirements)
+run_cmake(ExportSymbolicComponent)
 run_cmake(TargetTypes)
 run_cmake(DependsMultiple)
 run_cmake(LinkOnly)
@@ -46,3 +47,4 @@ run_cmake(EmptyConfig)
 run_cmake(FileSetHeaders)
 run_cmake(DependencyVersionCMake)
 run_cmake(DependencyVersionCps)
+run_cmake(TransitiveSymbolicComponent)

+ 16 - 0
Tests/RunCMake/ExportPackageInfo/TransitiveSymbolicComponent-check.cmake

@@ -0,0 +1,16 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/TransitiveSymbolicComponent-build")
+
+
+file(READ "${out_dir}/bar.cps" content)
+expect_value("${content}" "bar" "name")
+expect_array("${content}" 1 "requires" "Symbolic" "components")
+expect_value("${content}" "test" "requires" "Symbolic" "components" 0)
+expect_value("${content}" "1.0" "requires" "Symbolic" "version")
+expect_array("${content}" 1 "requires" "Symbolic" "hints")
+expect_value("${content}" "${CMAKE_CURRENT_LIST_DIR}/cps" "requires" "Symbolic" "hints" 0)
+
+string(JSON component GET "${content}" "components" "bar")
+expect_array("${component}" 1 "requires")
+expect_value("${component}" "Symbolic:test" "requires" 0)

+ 14 - 0
Tests/RunCMake/ExportPackageInfo/TransitiveSymbolicComponent.cmake

@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 4.0)
+
+add_library(bar INTERFACE)
+
+find_package(Symbolic REQUIRED CONFIG
+  COMPONENTS foo test
+  NO_DEFAULT_PATH
+  PATHS ${CMAKE_CURRENT_LIST_DIR}
+)
+
+target_link_libraries(bar INTERFACE Symbolic::test)
+
+install(TARGETS bar EXPORT bar DESTINATION .)
+export(EXPORT bar PACKAGE_INFO bar)

+ 17 - 0
Tests/RunCMake/ExportPackageInfo/cps/symbolic.cps

@@ -0,0 +1,17 @@
+{
+  "components" :
+  {
+    "foo" :
+    {
+      "type" : "interface"
+    },
+    "test" :
+    {
+      "type" : "symbolic"
+    }
+  },
+  "cps_path" : "@prefix@",
+  "cps_version" : "0.13.0",
+  "name" : "Symbolic",
+  "version": "1.0"
+}

+ 7 - 0
Tests/RunCMake/FileAPI/codemodel-v2-check.py

@@ -314,6 +314,10 @@ def check_target(c, major, minor):
             expected_keys.append("abstract")
             assert is_bool(obj["abstract"], expected["abstract"])
 
+        if expected["symbolic"] is not None:
+            expected_keys.append("symbolic")
+            assert is_bool(obj["symbolic"], expected["symbolic"])
+
         assert is_dict(obj["paths"])
         assert sorted(obj["paths"].keys()) == ["build", "source"]
         assert matches(obj["paths"]["build"], expected["build"])
@@ -895,6 +899,7 @@ def gen_check_build_system_targets(c, g, inSource):
         read_codemodel_json_data("targets/link_imported_static_exe.json"),
         read_codemodel_json_data("targets/link_imported_object_exe.json"),
         read_codemodel_json_data("targets/link_imported_interface_exe.json"),
+        read_codemodel_json_data("targets/link_imported_interface_symbolic_exe.json"),
 
         read_codemodel_json_data("targets/all_build_interface.json"),
         read_codemodel_json_data("targets/zero_check_interface.json"),
@@ -1063,11 +1068,13 @@ def gen_check_abstract_targets(c, g, inSource):
         read_codemodel_json_data("targets/imported_exe.json"),
         read_codemodel_json_data("targets/imported_lib.json"),
         read_codemodel_json_data("targets/imported_interface_lib.json"),
+        read_codemodel_json_data("targets/imported_interface_symbolic_lib.json"),
         read_codemodel_json_data("targets/imported_object_lib.json"),
         read_codemodel_json_data("targets/imported_shared_lib.json"),
         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")
     ]
 
     if sys.platform == "darwin":

+ 4 - 2
Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json

@@ -8,6 +8,7 @@
         "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
         "^link_imported_exe::@ba7eb709d0b48779c6c8$",
         "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+        "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
         "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
         "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
         "^link_imported_static_exe::@ba7eb709d0b48779c6c8$"
@@ -15,6 +16,7 @@
     "abstractTargetIds": [
         "^imported_exe::@ba7eb709d0b48779c6c8$",
         "^imported_interface_lib::@ba7eb709d0b48779c6c8$",
+        "^imported_interface_symbolic_lib::@ba7eb709d0b48779c6c8$",
         "^imported_lib::@ba7eb709d0b48779c6c8$",
         "^imported_object_lib::@ba7eb709d0b48779c6c8$",
         "^imported_shared_lib::@ba7eb709d0b48779c6c8$",
@@ -42,7 +44,7 @@
             "backtrace": [
                 {
                     "file": "^imported/CMakeLists\\.txt$",
-                    "line": 35,
+                    "line": 39,
                     "command": "install",
                     "hasParent": true
                 },
@@ -72,7 +74,7 @@
             "backtrace": [
                 {
                     "file": "^imported/CMakeLists\\.txt$",
-                    "line": 38,
+                    "line": 42,
                     "command": "install",
                     "hasParent": true
                 },

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

@@ -9,7 +9,8 @@
         "^iface_srcs::@25b7fa8ea00134654b85$"
     ],
     "abstractTargetIds": [
-        "^iface_none::@25b7fa8ea00134654b85$"
+        "^iface_none::@25b7fa8ea00134654b85$",
+        "^iface_symbolic::@25b7fa8ea00134654b85$"
     ],
     "projectName": "Interface",
     "minimumCMakeVersion": "3.13",

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

@@ -12,12 +12,14 @@
         "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
         "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
         "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
-        "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$"
+        "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+        "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$"
     ],
     "abstractTargetIds": [
         "^imported_exe::@ba7eb709d0b48779c6c8$",
         "^imported_lib::@ba7eb709d0b48779c6c8$",
         "^imported_interface_lib::@ba7eb709d0b48779c6c8$",
+        "^imported_interface_symbolic_lib::@ba7eb709d0b48779c6c8$",
         "^imported_object_lib::@ba7eb709d0b48779c6c8$",
         "^imported_shared_lib::@ba7eb709d0b48779c6c8$",
         "^imported_static_lib::@ba7eb709d0b48779c6c8$"

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

@@ -11,6 +11,7 @@
         "^iface_srcs::@25b7fa8ea00134654b85$"
     ],
     "abstractTargetIds": [
-        "^iface_none::@25b7fa8ea00134654b85$"
+        "^iface_none::@25b7fa8ea00134654b85$",
+        "^iface_symbolic::@25b7fa8ea00134654b85$"
     ]
 }

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [
@@ -96,6 +97,10 @@
         {
             "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
             "backtrace": null
+        },
+        {
+            "id": "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
         }
     ]
 }

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [
@@ -201,6 +202,10 @@
             "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
             "backtrace": null
         },
+        {
+          "id": "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
+          "backtrace": null
+        },
         {
             "id": "^iface_srcs::@25b7fa8ea00134654b85$",
             "backtrace": null

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
   "imported": null,
   "local": null,
   "abstract": null,
+  "symbolic": null,
   "isGeneratorProvided": null,
   "fileSets": [
     {

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

@@ -7,6 +7,7 @@
   "imported": null,
   "local": null,
   "abstract": null,
+  "symbolic": null,
   "isGeneratorProvided": null,
   "fileSets": [
     {

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

+ 1 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

+ 1 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

+ 39 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_symbolic.json

@@ -0,0 +1,39 @@
+{
+    "name": "iface_symbolic",
+    "id": "^iface_symbolic::@25b7fa8ea00134654b85$",
+    "directorySource": "^interface$",
+    "projectName": "Interface",
+    "type": "INTERFACE_LIBRARY",
+    "imported": null,
+    "local": null,
+    "symbolic": true,
+    "abstract": true,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [],
+    "sourceGroups": null,
+    "compileGroups": null,
+    "backtrace": [
+      {
+        "file": "^interface/CMakeLists\\.txt$",
+        "line": 4,
+        "command": "add_library",
+        "hasParent": true
+      },
+      {
+        "file": "^interface/CMakeLists\\.txt$",
+        "line": null,
+        "command": null,
+        "hasParent": false
+      }
+    ],
+    "folder": null,
+    "nameOnDisk": null,
+    "artifacts": null,
+    "build": "^interface$",
+    "source": "^interface$",
+    "install": null,
+    "link": null,
+    "archive": null,
+    "dependencies": null
+}

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

+ 39 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/imported_interface_symbolic_lib.json

@@ -0,0 +1,39 @@
+{
+    "name": "imported_interface_symbolic_lib",
+    "id": "^imported_interface_symbolic_lib::@ba7eb709d0b48779c6c8$",
+    "directorySource": "^imported$",
+    "projectName": "Imported",
+    "type": "INTERFACE_LIBRARY",
+    "imported": true,
+    "local": true,
+    "abstract": true,
+    "symbolic": true,
+    "isGeneratorProvided": null,
+    "fileSets": null,
+    "sources": [],
+    "sourceGroups": null,
+    "compileGroups": null,
+    "backtrace": [
+        {
+            "file": "^imported/CMakeLists\\.txt$",
+            "line": 35,
+            "command": "add_library",
+            "hasParent": true
+        },
+        {
+            "file": "^imported/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": null,
+    "artifacts": null,
+    "build": "^imported$",
+    "source": "^imported$",
+    "install": null,
+    "link": null,
+    "archive": null,
+    "dependencies": null
+}

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": true,
     "local": true,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": true,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [],

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

+ 97 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_symbolic_exe.json

@@ -0,0 +1,97 @@
+{
+    "name": "link_imported_interface_symbolic_exe",
+    "id": "^link_imported_interface_symbolic_exe::@ba7eb709d0b48779c6c8$",
+    "directorySource": "^imported$",
+    "projectName": "Imported",
+    "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": "^imported/CMakeLists\\.txt$",
+                    "line": 36,
+                    "command": "add_executable",
+                    "hasParent": true
+                },
+                {
+                    "file": "^imported/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": null,
+            "compileCommandFragments": null
+        }
+    ],
+    "backtrace": [
+        {
+            "file": "^imported/CMakeLists\\.txt$",
+            "line": 36,
+            "command": "add_executable",
+            "hasParent": true
+        },
+        {
+            "file": "^imported/CMakeLists\\.txt$",
+            "line": null,
+            "command": null,
+            "hasParent": false
+        }
+    ],
+    "folder": null,
+    "nameOnDisk": "^link_imported_interface_symbolic_exe(\\.exe)?$",
+    "artifacts": [
+        {
+            "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_symbolic_exe(\\.exe)?$",
+            "_dllExtra": false
+        },
+        {
+            "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_symbolic_exe\\.pdb$",
+            "_dllExtra": true
+        }
+    ],
+    "build": "^imported$",
+    "source": "^imported$",
+    "install": null,
+    "link": {
+        "language": "C",
+        "lto": null,
+        "commandFragments": null
+    },
+    "archive": null,
+    "dependencies": [
+        {
+            "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+            "backtrace": null
+        }
+    ]
+}

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": null,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

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

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

+ 1 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

+ 1 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json

@@ -7,6 +7,7 @@
     "imported": null,
     "local": null,
     "abstract": null,
+    "symbolic": null,
     "isGeneratorProvided": true,
     "fileSets": null,
     "sources": [

部分文件因为文件数量过多而无法显示