From: Cordell Bloor <cgmb@slerp.xyz>
Date: Sun, 11 Feb 2024 23:05:47 -0700
Subject: remove redundant target_link_libraries

The redundant use of target_link_libraries in this case is a problem,
as some LLVM static libraries contain static initialization routines
that must only be run once. If they are run twice (e.g., because they
are linked twice), then they will fail and terminate the program. e.g.
static-func-full-module-prefix in llvm/lib/ProfileData/InstrProf.cpp
---
 CMakeLists.txt | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3735cb8..479ec97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,28 +88,8 @@ if (NOT HIPIFY_CLANG_TESTS_ONLY)
 
   # Link against LLVM and CLANG libraries.
   target_link_libraries(hipify-clang PRIVATE
-    clangASTMatchers
-    clangFrontend
     clangTooling
-    clangParse
-    clangSerialization
-    clangSema
-    clangEdit
-    clangFormat
-    clangLex
-    clangAnalysis
-    clangDriver
-    clangAST
-    clangToolingCore
-    clangRewrite
-    clangBasic
-    LLVMProfileData
-    LLVMSupport
-    LLVMMCParser
-    LLVMMC
-    LLVMBitReader
-    LLVMOption
-    LLVMCore)
+  )
 
   if(LLVM_PACKAGE_VERSION VERSION_GREATER "6.0.1")
     target_link_libraries(hipify-clang PRIVATE clangToolingInclusions)
