Skip to content

Commit d4567f7

Browse files
committed
Use rootcling -m option to avoid duplicates in dictionaries
1 parent d3b8d8b commit d4567f7

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

cmake/AddRootDictionary.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function(add_root_dictionary target)
144144
--include_dirs -I$<JOIN:${includeDirs},$<SEMICOLON>-I>
145145
$<$<BOOL:${prop}>:--compile_defs>
146146
$<$<BOOL:${prop}>:-D$<JOIN:${prop},$<SEMICOLON>-D>>
147+
--pcmdeps "$<REMOVE_DUPLICATES:${list_pcm_deps_${target}}>"
147148
--headers "${headers}"
148149
COMMAND
149150
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${pcmBase} ${pcmFile}

cmake/rootcling_wrapper.sh.in

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ while [[ $# -gt 0 ]]; do
3737
ROOTMAP_FILE="$2"
3838
shift 2
3939
;;
40+
--pcmdeps)
41+
PCMDEPS="$2"
42+
shift 2
43+
;;
4044
*)
4145
if [[ -z "$1" ]]; then
4246
shift
@@ -77,7 +81,14 @@ LOGFILE=${DICTIONARY_FILE}.log
7781
-rml ${ROOTMAP_LIBRARY_NAME} \
7882
${INCLUDE_DIRS//;/ } \
7983
${COMPILE_DEFINITIONS//;/ } \
80-
${HEADERS//;/ } > ${LOGFILE} 2>&1 || cat ${LOGFILE} >&2
84+
${PCMDEPS:+-m }${PCMDEPS//;/ -m } \
85+
${HEADERS//;/ } \
86+
> ${LOGFILE} 2>&1 || cat ${LOGFILE} >&2
87+
88+
if [[ $? != "0" ]]; then
89+
rm $DICTIONARY_FILE
90+
exit 1
91+
fi
8192

8293
MSG="Warning: Unused class rule"
8394
if [[ -s ${LOGFILE} ]]; then

0 commit comments

Comments
 (0)