-
Notifications
You must be signed in to change notification settings - Fork 7
/
llvm-rc-wrapper
executable file
·78 lines (74 loc) · 1.75 KB
/
llvm-rc-wrapper
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /bin/bash
shopt -s nocasematch
llvm_rc_args=()
while [ $# -gt 1 ]; do
param=$1
shift
case "$param" in
-c*|/c*)
if [ "${#param}" -eq 2 ]; then
llvm_rc_args+=("/C" "$1")
shift
else
llvm_rc_args+=("/C" "${param:2}")
fi
;;
-d*|/d*)
if [ "${#param}" -eq 2 ]; then
llvm_rc_args+=("/D" "$1")
shift
else
llvm_rc_args+=("/D" "${param:2}")
fi
;;
-fo*|/fo*)
if [ "${#param}" -eq 3 ]; then
llvm_rc_args+=("/FO" "$1")
shift
else
llvm_rc_args+=("/FO" "${param:3}")
fi
;;
-i*|/i*)
if [ "${#param}" -eq 2 ]; then
llvm_rc_args+=("/I" "$1")
shift
else
llvm_rc_args+=("/I" "${param:2}")
fi
;;
-ln*|/ln*)
if [ "${#param}" -eq 3 ]; then
llvm_rc_args+=("/LN" "$1")
shift
else
llvm_rc_args+=("/LN" "${param:3}")
fi
;;
-l*|/l*)
if [ "${#param}" -eq 2 ]; then
llvm_rc_args+=("/l" "$1")
shift
else
llvm_rc_args+=("/l" "${param:2}")
fi
;;
-u*|/u*)
if [ "${#param}" -eq 2 ]; then
llvm_rc_args+=("/U" "$1")
shift
else
llvm_rc_args+=("/U" "${param:2}")
fi
;;
*) llvm_rc_args+=("$param");;
esac
done
rc_file=$1
# Fix: llvm-rc: Error in VERSIONINFO statement (ID 1):
# Non-ASCII 8-bit codepoint (169) can't occur in a non-Unicode string>
# Non-ASCII 8-bit codepoint (251) can't occur in a non-Unicode string>
sed -i "s/\\\\169/(C)/g;s/\xa9/(C)/g;s/\\\\xa9/(C)/g;s/\\\\251/(C)/g;s/\xfb/(C)/g;s/\\\\xfb/(C)/g" "$rc_file"
llvm_rc_args+=("$rc_file")
echo llvm-rc-${LLVM_VER} "${llvm_rc_args[@]}"
llvm-rc-${LLVM_VER} "${llvm_rc_args[@]}"