File: 0022-fix-hip-config-for-c-projects.patch

package info (click to toggle)
rocm-hipamd 5.7.1-6%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 19,840 kB
  • sloc: cpp: 243,188; ansic: 35,728; perl: 1,227; sh: 902; python: 588; asm: 166; makefile: 59
file content (25 lines) | stat: -rw-r--r-- 980 bytes parent folder | download | duplicates (2)
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
From: Cordell Bloor <cgmb@slerp.xyz>
Date: Mon, 22 May 2023 01:27:42 -0600
Subject: fix hip-config for c projects

When the CXX language is not enabled, then CMAKE_CXX_COMPILER_ID will
not be defined and (if unquoted) the left side of the comparison will
evaluate to nothing and therefore be a syntax error. Quoting the
variable ensures that even if the variable is undefined, the left side
of the comparison will be the empty string and therefore avoid a syntax
error.

Bug-Debian: http://bugs.debian.org/1035835
Forwarded: no
---
--- a/hipamd/hip-config-amd.cmake
+++ b/hipamd/hip-config-amd.cmake
@@ -123,7 +123,7 @@
     hip_add_interface_link_flags(hip::device --offload-arch=${GPU_TARGET})
 endforeach()
 #Add support for parallel build and link
-if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   check_cxx_compiler_flag("-parallel-jobs=1" HIP_CLANG_SUPPORTS_PARALLEL_JOBS)
 endif()
 if(HIP_CLANG_NUM_PARALLEL_JOBS GREATER 1)