[PATCH 02/10] link against single shared libclang-cpp when building with llvm 9, too
authorAndreas Beckmann <anbe@debian.org>
Tue, 7 Apr 2020 23:33:12 +0000 (01:33 +0200)
committerAndreas Beckmann <anbe@debian.org>
Sun, 2 Apr 2023 23:08:50 +0000 (00:08 +0100)
Gbp-Pq: Name 2002-link-against-single-shared-libclang-cpp-when-buildin.patch

cmake/LLVM.cmake

index f638178ba0591c3274324c7e7e741cb25dabc20d..10202ad8e70feea9af6506a1396f019f0abaa09c 100644 (file)
@@ -257,8 +257,8 @@ string(STRIP "${LLVM_SYSLIBS}" LLVM_SYSLIBS)
 ####################################################################
 
 # llvm-config does not include clang libs
-if((9 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
-  # For Clang 10+, link against a single shared library instead of multiple component shared
+if((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
+  # For Clang 9+, link against a single shared library instead of multiple component shared
   # libraries.
   if("${LLVM_LIBNAMES}" MATCHES "LLVMTCE")
     set(CLANG_LIBNAMES clangTCE-cpp)
@@ -278,7 +278,7 @@ endif()
 foreach(LIBNAME ${CLANG_LIBNAMES})
   find_library(C_LIBFILE_${LIBNAME} NAMES "${LIBNAME}" HINTS "${LLVM_LIBDIR}")
   list(APPEND CLANG_LIBFILES "${C_LIBFILE_${LIBNAME}}")
-  if(UNIX AND (NOT APPLE))
+  if(UNIX AND (NOT APPLE) AND (NOT ((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))))
     set(LLVM_LDFLAGS "${LLVM_LDFLAGS} -Wl,--exclude-libs,lib${LIBNAME}")
   endif()
 endforeach()