Răsfoiți Sursa

cmGeneratorTarget: Protect macro code layout from clang-format

The `IMPLEMENT_VISIT_IMPL` macro must preserve a space before the `>`
character in case the `DATATYPE` is a template type ending in `>`.
Manually format the macro layout as clang-format would except for this
space.  Then add markup to tell clang-format not to format this macro.
Brad King 9 ani în urmă
părinte
comite
c7006d2ef1
1 a modificat fișierele cu 12 adăugiri și 12 ștergeri
  1. 12 12
      Source/cmGeneratorTarget.cxx

+ 12 - 12
Source/cmGeneratorTarget.cxx

@@ -559,18 +559,18 @@ static void handleSystemIncludesDep(cmLocalGenerator *lg,
     }
 }
 
-#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \
-  { \
-  std::vector<cmSourceFile*> sourceFiles; \
-  this->GetSourceFiles(sourceFiles, config); \
-  TagVisitor< DATA##Tag DATATYPE > visitor(this, data); \
-  for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
-      si != sourceFiles.end(); ++si) \
-    { \
-    visitor.Accept(*si); \
-    } \
-  } \
-
+/* clang-format off */
+#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE)                                  \
+  {                                                                           \
+    std::vector<cmSourceFile*> sourceFiles;                                   \
+    this->GetSourceFiles(sourceFiles, config);                                \
+    TagVisitor< DATA##Tag DATATYPE > visitor(this, data);                     \
+    for (std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
+         si != sourceFiles.end(); ++si) {                                     \
+      visitor.Accept(*si);                                                    \
+    }                                                                         \
+  }
+/* clang-format on */
 
 #define IMPLEMENT_VISIT(DATA) \
   IMPLEMENT_VISIT_IMPL(DATA, EMPTY) \