tools/cl2c: change to tools/source2c and allow non-OpenCL source files

This commit is contained in:
Lynne
2023-03-18 19:15:41 +01:00
parent 7cfd7e4af4
commit 88e2cca3db
17 changed files with 42 additions and 36 deletions

View File

@@ -1,7 +1,6 @@
#!/bin/sh
# Convert an OpenCL source file into a C source file containing the
# OpenCL source as a C string. Also adds a #line directive so that
# compiler messages are useful.
# Convert a source file into a C source file containing the
# source code as a C string.
# This file is part of FFmpeg.
#
@@ -22,12 +21,11 @@
input="$1"
output="$2"
name=$(basename "$input" | sed 's/.cl$//')
name=$(basename "$input" | sed 's/\./_/')
cat >$output <<EOF
// Generated from $input
const char *ff_opencl_source_$name =
"#line 1 \"$input\"\n"
const char *ff_source_$name =
EOF
# Convert \ to \\ and " to \", then add " to the start and end of the line.