File: select-clangpp.diff

package info (click to toggle)
clazy 1.15-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,244 kB
  • sloc: cpp: 25,011; python: 1,387; xml: 420; sh: 236; makefile: 45
file content (38 lines) | stat: -rw-r--r-- 1,525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Author: Pino Toscano <pino@debian.org>
Description: Select which executable to use as "clang++"
 This way, we can set a specific one, in case the distribution ships different
 versions of LLVM/Clang.
Forwarded: no
Last-Update: 2019-02-01

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,10 @@ if(NOT CLAZY_BUILD_WITH_CLANG AND MSVC A
   message(FATAL_ERROR "\nOn MSVC you need to pass -DCLANG_LIBRARY_IMPORT=C:/path/to/llvm-build/lib/clang.lib to cmake when building Clazy.\nAlso make sure you've built LLVM with -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON")
 endif()
 
+if(NOT CLANGPP_EXECUTABLE)
+  set(CLANGPP_EXECUTABLE "clang++")
+endif()
+
 if(MSVC)
   # disable trigger-happy warnings from Clang/LLVM headers
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244 /wd4291 /wd4800 /wd4141 /wd4146 /wd4251")
--- a/clazy.cmake
+++ b/clazy.cmake
@@ -34,7 +34,7 @@ HELP() {
 
 VERSION() {
     echo "clazy version: @CLAZY_PRINT_VERSION@"
-    ${CLANGXX:-clang++} --version | head -1 | awk '{printf("clang version: %s\n",$3)}'
+    ${CLANGXX:-@CLANGPP_EXECUTABLE@} --version | head -1 | awk '{printf("clang version: %s\n",$3)}'
 }
 
 PRLIST() {
@@ -147,5 +147,5 @@ then
     $(dirname $0)/bin/clazy-standalone "$@"
   fi
 else
-  ${CLANGXX:-clang++} -Qunused-arguments -Xclang -load -Xclang $ClazyPluginLib -Xclang -add-plugin -Xclang clazy $ExtraClangOptions "$@"
+  ${CLANGXX:-@CLANGPP_EXECUTABLE@} -Qunused-arguments -Xclang -load -Xclang $ClazyPluginLib -Xclang -add-plugin -Xclang clazy $ExtraClangOptions "$@"
 fi