summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2019-08-22 00:40:47 -0500
committerrcombs <rcombs@rcombs.me>2020-06-01 22:10:41 -0500
commitfb17ba86a871b858069472d4afd8509732d58e49 (patch)
treecc2017110cb90b2b135dbd139e0779fcc13c8d76 /compat
parent782865bf3094e36cbb4bd9cfacda252307e6589d (diff)
downloadffmpeg-fb17ba86a871b858069472d4afd8509732d58e49.tar.gz
compat/cuda/ptx2c: remove shell loop; fix BSD sed compat
This fixes building on macOS, and improves build times dramatically there
Diffstat (limited to 'compat')
-rwxr-xr-xcompat/cuda/ptx2c.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 0750e7a3b7..48452379c2 100755
--- a/compat/cuda/ptx2c.sh
+++ b/compat/cuda/ptx2c.sh
@@ -27,10 +27,8 @@ IN="$2"
NAME="$(basename "$IN" | sed 's/\..*//')"
printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
-while IFS= read -r LINE
-do
- printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT"
-done < "$IN"
-printf ";\n" >> "$OUT"
+echo >> "$OUT"
+sed -e "$(printf 's/\r//g')" -e 's/["\\]/\\&/g' -e "$(printf 's/^/\t"/')" -e 's/$/\\n"/' < "$IN" >> "$OUT"
+echo ";" >> "$OUT"
exit 0