[clang] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do (PR #108549)

Martin 'JaMa' Jansa via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 05:30:34 PDT 2024


https://github.com/shr-project created https://github.com/llvm/llvm-project/pull/108549

* other libraries are installed in 'lib64' or 'lib32' based on LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always installed in 'lib'

>From e2f395036234aa26da290dd827b787ea48011d0b Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa at gmail.com>
Date: Fri, 13 Sep 2024 13:38:08 +0200
Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do

* other libraries are installed in 'lib64' or 'lib32' based on
  LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always
  installed in 'lib'

Signed-off-by: Martin Jansa <martin.jansa at gmail.com>
---
 clang/tools/scan-build-py/CMakeLists.txt | 50 ++++++++++++------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt
index 9273eb5ed977e4..0c71c013ee62de 100644
--- a/clang/tools/scan-build-py/CMakeLists.txt
+++ b/clang/tools/scan-build-py/CMakeLists.txt
@@ -77,52 +77,52 @@ foreach(lib ${LibExecs})
 endforeach()
 
 foreach(lib ${LibScanbuild})
-  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}
+  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}
                      COMMAND ${CMAKE_COMMAND} -E make_directory
                        ${CMAKE_BINARY_DIR}/lib
                      COMMAND ${CMAKE_COMMAND} -E make_directory
-                       ${CMAKE_BINARY_DIR}/lib/libscanbuild
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild
                      COMMAND ${CMAKE_COMMAND} -E copy
-                       ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}
-                       ${CMAKE_BINARY_DIR}/lib/libscanbuild/
-                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
-  list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
-  install(FILES lib/libscanbuild/${lib}
-          DESTINATION lib/libscanbuild
+                       ${CMAKE_CURRENT_SOURCE_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/
+                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib})
+  list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib})
+  install(FILES lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}
+          DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild
           COMPONENT scan-build-py)
 endforeach()
 
 foreach(resource ${LibScanbuildResources})
-  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}
+  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}
                      COMMAND ${CMAKE_COMMAND} -E make_directory
                        ${CMAKE_BINARY_DIR}/lib
                      COMMAND ${CMAKE_COMMAND} -E make_directory
-                       ${CMAKE_BINARY_DIR}/lib/libscanbuild
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild
                      COMMAND ${CMAKE_COMMAND} -E make_directory
-                       ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources
                      COMMAND ${CMAKE_COMMAND} -E copy
-                       ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}
-                       ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources
-                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
-  list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
-  install(FILES lib/libscanbuild/resources/${resource}
-          DESTINATION lib/libscanbuild/resources
+                       ${CMAKE_CURRENT_SOURCE_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources
+                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource})
+  list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource})
+  install(FILES lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}
+          DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources
           COMPONENT scan-build-py)
 endforeach()
 
 foreach(lib ${LibEar})
-  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib}
+  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}
                      COMMAND ${CMAKE_COMMAND} -E make_directory
                        ${CMAKE_BINARY_DIR}/lib
                      COMMAND ${CMAKE_COMMAND} -E make_directory
-                       ${CMAKE_BINARY_DIR}/lib/libear
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear
                      COMMAND ${CMAKE_COMMAND} -E copy
-                       ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}
-                       ${CMAKE_BINARY_DIR}/lib/libear/
-                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
-  list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
-  install(FILES lib/libear/${lib}
-          DESTINATION lib/libear
+                       ${CMAKE_CURRENT_SOURCE_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}
+                       ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/
+                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib})
+  list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib})
+  install(FILES lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}
+          DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear
           COMPONENT scan-build-py)
 endforeach()
 



More information about the cfe-commits mailing list