[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>
Fri, 15 Oct 2021 16:22:36 +0000 (17:22 +0100)
Gbp-Pq: Name 2002-link-against-single-shared-libclang-cpp-when-buildin.patch

cmake/LLVM.cmake

index 79801af9b50a8edbcc08afa0674f81d3c4852587..6ff309517858cf86888924cf0e1b86369d224192 100644 (file)
@@ -250,8 +250,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)
@@ -268,7 +268,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()