forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrootcling_wrapper.sh.in
executable file
·113 lines (101 loc) · 2.05 KB
/
rootcling_wrapper.sh.in
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
#!/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)
LD_LIBRARY_PATH="$2"
shift 2
;;
--dictionary_file)
DICTIONARY_FILE="$2"
shift 2
;;
--rootmap_file)
ROOTMAP_FILE="$2"
shift 2
;;
--pcmdeps)
PCMDEPS="$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
@CMAKE_COMMAND@ -E env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} @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 || cat ${LOGFILE} >&2
if [[ $? != "0" ]]; then
rm $DICTIONARY_FILE
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