forked from gwoltman/gpuowl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenbundle.sh
More file actions
executable file
·39 lines (28 loc) · 882 Bytes
/
genbundle.sh
File metadata and controls
executable file
·39 lines (28 loc) · 882 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
cat <<EOM
// Copyright (C) Mihai Preda
// Generated file, do not edit. See genbundle.sh and src/cl/*.cl
#include <vector>
static const std::vector<const char*> CL_FILES{
EOM
names=
for xx in "$@"
do
x=$(basename "$xx")
if [ "$x" = "genbundle.sh" ] ; then continue ; fi
names=${names}\"${x}\",
echo "// $xx"
# MSVC cannot handle string constants longer than 16KB. Thus, output one raw line at a time and concatenate them using the C++ preprocessor
echo ' R"cltag('
while IFS= read -r line; do
echo ')cltag" R"cltag('"$line"
done < $xx
echo ')cltag",'
echo
done
echo '};'
echo "static const std::vector<const char*> CL_FILE_NAMES{${names}};"
cat <<EOM
const std::vector<const char*>& getClFileNames() { return CL_FILE_NAMES; }
const std::vector<const char*>& getClFiles() { return CL_FILES; }
EOM