pineapple-src/externals/vcpkg/ports/ffmpeg/0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch
2022-07-23 03:01:36 +02:00

44 lines
1.3 KiB
Diff
Executable file

From 6dd12a7210fb4cf2e69b6c83628021d83ba132c3 Mon Sep 17 00:00:00 2001
From: "Don C. Bigler" <don.bigler@framatome.com>
Date: Fri, 4 Dec 2020 12:39:55 -0500
Subject: [PATCH] Patch for ticket #9019 CUDA Compile Broken Using MSVC
Signed-off-by: Don C. Bigler <don.bigler@framatome.com>
---
compat/cuda/ptx2c.sh | 7 ++++---
configure | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 48452379c2..1c486dc30e 100755
--- a/compat/cuda/ptx2c.sh
+++ b/compat/cuda/ptx2c.sh
@@ -26,9 +26,10 @@ OUT="$1"
IN="$2"
NAME="$(basename "$IN" | sed 's/\..*//')"
-printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
+printf "const char %s_ptx[] = {\\" "$NAME" > "$OUT"
echo >> "$OUT"
-sed -e "$(printf 's/\r//g')" -e 's/["\\]/\\&/g' -e "$(printf 's/^/\t"/')" -e 's/$/\\n"/' < "$IN" >> "$OUT"
-echo ";" >> "$OUT"
+xxd -i < "$IN" >> "$OUT"
+echo " ,0x00" >> "$OUT"
+echo "};" >> "$OUT"
exit 0
diff --git a/configure b/configure
index 1b1b140d6f..048e02355f 100755
--- a/configure
+++ b/configure
@@ -1050,6 +1050,7 @@ test_nvcc(){
tmpo_=$TMPO
[ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
+ test_cmd xxd
}
check_nvcc() {
--
2.26.2.windows.1