[PATCH] D54930: [gn build] Add a script to check if source lists in BUILD.gn files and CMakeLists.txt files match.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 29 07:57:27 PST 2018


thakis added inline comments.


================
Comment at: llvm/utils/gn/build/sync_source_lists_from_cmake.py:48
+            for s in cmake_cpp - gn_cpp:
+                print('    "%s",' % s)
+        if gn_cpp - cmake_cpp:
----------------
phosek wrote:
> You could do just:
> ```
> added = cmake_cpp - gn_cpp
> if added:
>   print('added:\n%s' % ',\n'.join(added))
> ```
Done.

To explain a bit why I did what I had: I'm indenting the "add
 lines to have the right amount of space in front and with quoting for copying the file right into a gn file, and with your approach I need to duplicated the indent string. But that's better than duplicating the set difference, and your approach is better without drawbacks in the remove case.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54930/new/

https://reviews.llvm.org/D54930





More information about the llvm-commits mailing list