You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a project uses CPM to pull in LLVM and builds the clang project of LLVM, then the target names clang-format and check-clang-format will conflict. Locally I fixed this by adding run- prefixes to each target.
The text was updated successfully, but these errors were encountered:
Ah that makes sense, I hadn't considered the LLVM project when I created the target names. To not break existing workflows, perhaps it would make sense to add an option CMAKE_FORMAT_PREFIX that adds a prefix to the target names to avoid such collisions?
I have the same issue, triggered by find_package(Clang)
CMake Error at /usr/lib/llvm-10/lib/cmake/clang/ClangTargets.cmake:37 (message):
Some (but not all) targets in this exportset were already defined.
Targets Defined: clang-format
My current fix is to add CPMAddPackage("gh:TheLartians/[email protected]") at the end of my CMakeLists.txt, after the find_package(Clang) statement. Adding a CMAKE_FORMAT_PREFIX option would work, but I believe you should ultimately change the default name of the target (such name collision can happen really easily).
If a project uses CPM to pull in LLVM and builds the
clang
project of LLVM, then the target namesclang-format
andcheck-clang-format
will conflict. Locally I fixed this by addingrun-
prefixes to each target.The text was updated successfully, but these errors were encountered: