Browse Source

cmGeneratorTarget: Add TransitiveProperty constructor to help some compilers

Some compilers have trouble initializing TransitiveProperty as a parent
class using an initializer list unless there is an explicit constructor:

* SunPro fails to compile
* XLClang seems to miscompile, exhibiting strange runtime behavior
Brad King 1 year ago
parent
commit
a11cbcc268
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Source/cmGeneratorTarget.h

+ 7 - 0
Source/cmGeneratorTarget.h

@@ -892,6 +892,13 @@ public:
 
   struct TransitiveProperty
   {
+#if defined(__SUNPRO_CC) || (defined(__ibmxl__) && defined(__clang__))
+    TransitiveProperty(cm::string_view interfaceName, UseTo usage)
+      : InterfaceName(interfaceName)
+      , Usage(usage)
+    {
+    }
+#endif
     cm::string_view InterfaceName;
     UseTo Usage;
   };