[PATCH] D134637: clang-tblgen build: avoid duplicate inclusion of libLLVMSupport

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 11:22:44 PDT 2022


beanz added a comment.

I think this approach mostly looks sane to me. @phosek, and @Ericson2314 may have different feedback.



================
Comment at: clang/lib/Support/CMakeLists.txt:23
+  # libLLVM-*.so).
+  llvm_add_library(clangSupport_tablegen
+    STATIC
----------------
Unless there is a reason not to you should probably use `add_llvm_library` here probably with the `BUILDTREE_ONLY` option.


================
Comment at: clang/lib/Support/CMakeLists.txt:27
+    ${clangSupport_sources})
+endif()
+
----------------
We could add an `else` here that creates the clangSupport_tablegen target as an alias of clangSupport
```
add_library(clangSupport_tablegen ALIAS clangSupport)
```

See: https://cmake.org/cmake/help/v3.13/command/add_library.html#alias-libraries

This would allow clang-tablegen to always depend on clangSupport_tablegen simplifying the code on that end.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134637



More information about the cfe-commits mailing list