-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathrootcling_wrapper.sh.in
More file actions
executable file
·138 lines (124 loc) · 2.83 KB
/
rootcling_wrapper.sh.in
File metadata and controls
executable file
·138 lines (124 loc) · 2.83 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash -e
# rootcling_wrapper.sh -- wrap call to rootcling to trap some warnings
# we want to treat as errors :
#
# Warning: Unused class rule
#
#
while [[ $# -gt 0 ]]; do
case "$1" in
--rootmap_library_name)
ROOTMAP_LIBRARY_NAME="$2"
shift 2
;;
--include_dirs)
INCLUDE_DIRS="$2"
shift 2
;;
--compile_defs)
COMPILE_DEFINITIONS="$2"
shift 2
;;
--headers)
HEADERS="$2"
shift 2
;;
--ld_library_path)
libpath="$2"
shift 2
;;
--dictionary_file)
DICTIONARY_FILE="$2"
shift 2
;;
--rootmap_file)
ROOTMAP_FILE="$2"
shift 2
;;
--pcmdeps)
PCMDEPS="$2"
shift 2
;;
--extra-patch)
EXTRA_PATCH="$2"
shift 2
;;
*)
if [[ -z "$1" ]]; then
shift
else
echo "Parameter unknown: $1" >&2
exit 1
fi
;;
esac
done
if [[ ! $ROOTMAP_LIBRARY_NAME ]]; then
echo "--rootmap_library_name option is mandatory but was not given" >&2
exit 1
fi
if [[ ! $INCLUDE_DIRS ]]; then
echo "--include_dirs option is mandatory but was not given" >&2
exit 1
fi
if [[ ! $DICTIONARY_FILE ]]; then
echo "--dictionary_file option is mandatory but was not given" >&2
exit 1
fi
if [[ ! $ROOTMAP_FILE ]]; then
echo "--rootmap_file option is mandatory but was not given" >&2
exit 1
fi
case $OSTYPE in
darwin*)
unset PCMDEPS
;;
*)
;;
esac
LOGFILE=${DICTIONARY_FILE}.log
echo @CMAKE_COMMAND@ -E env "LD_LIBRARY_PATH=$libpath" @ROOT_rootcling_CMD@ \
-f $DICTIONARY_FILE \
-inlineInputHeader \
-noGlobalUsingStd \
-rmf ${ROOTMAP_FILE} \
-rml ${ROOTMAP_LIBRARY_NAME} \
${INCLUDE_DIRS//;/ } \
${COMPILE_DEFINITIONS//;/ } \
${PCMDEPS:+-m }${PCMDEPS//;/ -m } \
${HEADERS//;/ } \
> ${LOGFILE} 2>&1 || ROOTCLINGRETVAL=$?
@CMAKE_COMMAND@ -E env "LD_LIBRARY_PATH=$libpath" @ROOT_rootcling_CMD@ \
-f $DICTIONARY_FILE \
-inlineInputHeader \
-noGlobalUsingStd \
-rmf ${ROOTMAP_FILE} \
-rml ${ROOTMAP_LIBRARY_NAME} \
${INCLUDE_DIRS//;/ } \
${COMPILE_DEFINITIONS//;/ } \
${PCMDEPS:+-m }${PCMDEPS//;/ -m } \
${HEADERS//;/ } \
> ${LOGFILE} 2>&1 || ROOTCLINGRETVAL=$?
# Add the extra patch file at the end of the generated dictionary.
# This is needed to inject custom streamers (e.g. for std::vector<PadFlags>)
# to our dictionary.
if [ ! X"${EXTRA_PATCH}" = X ]; then
cat $EXTRA_PATCH >> ${DICTIONARY_FILE}
fi
if [[ ${ROOTCLINGRETVAL:-0} != "0" ]]; then
cat ${LOGFILE} >&2
rm -f $DICTIONARY_FILE
echo "ROOT CLING Dictionary generation of $DICTIONARY_FILE failed with error code $ROOTCLINGRETVAL"
exit 1
fi
MSG="Warning: Unused class rule"
if [[ -s ${LOGFILE} ]]; then
WARNINGS=$(grep -c "${MSG}" ${LOGFILE} || :)
if [[ ! $WARNINGS == 0 ]]; then
echo "ERROR: please fix the warnings below about unused class rule" >&2
grep "$MSG" ${LOGFILE} >&2
rm $DICTIONARY_FILE
exit 1
fi
fi
exit 0