]> git.proxmox.com Git - llvm-toolchain.git/commitdiff
d/rules: Check for llvm-spirv with version suffix
authorJordan Justen <jljusten@debian.org>
Wed, 26 Oct 2022 17:23:14 +0000 (10:23 -0700)
committerJordan Justen <jljusten@debian.org>
Wed, 26 Oct 2022 17:25:13 +0000 (10:25 -0700)
Since llvm-spirv-13, the '-13' suffix has been added to the
executable.

Signed-off-by: Jordan Justen <jljusten@debian.org>
debian/changelog
debian/rules

index ba8dbe854b2a6a2a9170d73c3f23082d3931c10f..d128799c0e0b925bed6e4c0eae9f729c39954afb 100644 (file)
@@ -7,6 +7,7 @@ llvm-toolchain-14 (1:14.0.6-7) UNRELEASED; urgency=medium
   * d/rules: Call bash to use 'command -v' to location llvm-spirv executable
   * d/rules: Set LLVM_SPIRV with cmake for libclc
   * d/patches: Drop libclc-llvm-spirv.diff now that we are setting LLVM_SPIRV
+  * d/rules: Check for llvm-spirv with version suffix
 
  -- Jordan Justen <jljusten@debian.org>  Wed, 26 Oct 2022 10:13:59 -0700
 
index efa4560dfa7895ffc3d54462416d2ef37d5f5dc8..f5739224af385309070913a1f75ce2383a67f71a 100755 (executable)
@@ -223,16 +223,22 @@ else
        control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev'
 endif
 
-LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv" 2>/dev/null)
+LLVM_SPIRV := $(shell bash -c "command -v llvm-spirv llvm-spirv-$(LLVM_VERSION)" 2>/dev/null)
 
 ifndef LLVM_SPIRV
        LLVM_SPIRV_INSTALLED = no
 else
-       ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0)
-# Too old llvm-spirv version are failing. See #52200
-               LLVM_SPIRV_INSTALLED = yes
+       # if executable is llvm-spirv without a -$(LLVM_VERSION) suffix
+       ifeq ($(LLVM_SPIRV:-$(LLVM_VERSION)=),$(LLVM_SPIRV))
+               # Too old llvm-spirv version are failing. See #52200
+               ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' llvm-spirv) gt 10.0.0 ; echo $$?),0)
+                       LLVM_SPIRV_INSTALLED = yes
+               else
+                       LLVM_SPIRV_INSTALLED = no
+               endif
        else
-               LLVM_SPIRV_INSTALLED = no
+               # llvm-spirv renamed llvm-spirv-$(LLVM_VERSION) as of llvm-spirv-13
+               LLVM_SPIRV_INSTALLED = yes
        endif
 endif