|
11 | 11 |
|
12 | 12 | include_guard() |
13 | 13 |
|
14 | | -configure_file(${CMAKE_CURRENT_LIST_DIR}/rootcling_wrapper.sh.in |
15 | | - ${CMAKE_BINARY_DIR}/rootcling_wrapper.sh @ONLY) |
| 14 | +set(O2_ROOT_DICTIONARY_APPEND_SCRIPT |
| 15 | + ${CMAKE_CURRENT_LIST_DIR}/AppendToRootDictionary.cmake) |
16 | 16 |
|
17 | 17 | # |
18 | 18 | # add_root_dictionary generates one dictionary to be added to a target. |
@@ -132,25 +132,43 @@ function(add_root_dictionary target) |
132 | 132 | set(includeDirs $<TARGET_PROPERTY:${target},INCLUDE_DIRECTORIES>) |
133 | 133 | set(includeDirs $<REMOVE_DUPLICATES:${includeDirs}>) |
134 | 134 |
|
135 | | - list(LENGTH A_EXTRA_PATCH hasExtraPatch) |
| 135 | + # the pcm dependencies (-m) are only meaningful where the modules are actually |
| 136 | + # loaded from disk, which is not the case on macOS |
| 137 | + set(pcmDeps $<REMOVE_DUPLICATES:$<TARGET_PROPERTY:${target},O2_PCM_DEPS>>) |
| 138 | + if(APPLE) |
| 139 | + set(pcmDeps) |
| 140 | + endif() |
| 141 | + |
| 142 | + if(A_EXTRA_PATCH) |
| 143 | + set(extraPatchCommand |
| 144 | + COMMAND ${CMAKE_COMMAND} |
| 145 | + -DDICTIONARY=${dictionaryFile} |
| 146 | + -DPATCH=${CMAKE_CURRENT_LIST_DIR}/${A_EXTRA_PATCH} |
| 147 | + -P ${O2_ROOT_DICTIONARY_APPEND_SCRIPT}) |
| 148 | + else() |
| 149 | + set(extraPatchCommand) |
| 150 | + endif() |
| 151 | + |
136 | 152 | # add a custom command to generate the dictionary using rootcling |
137 | 153 | # cmake-format: off |
138 | 154 | add_custom_command( |
139 | 155 | OUTPUT ${dictionaryFile} ${pcmFile} ${rootmapFile} |
140 | 156 | VERBATIM |
| 157 | + COMMAND_EXPAND_LISTS |
141 | 158 | COMMAND |
142 | | - ${CMAKE_BINARY_DIR}/rootcling_wrapper.sh |
143 | | - --rootmap_file ${rootmapFile} |
144 | | - --dictionary_file ${dictionaryFile} |
145 | | - --ld_library_path ${LD_LIBRARY_PATH} |
146 | | - --rootmap_library_name $<TARGET_FILE_NAME:${target}> |
147 | | - --include_dirs -I$<JOIN:${includeDirs},$<SEMICOLON>-I> |
148 | | - $<$<BOOL:${prop}>:--compile_defs> |
| 159 | + ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} |
| 160 | + ${ROOT_rootcling_CMD} |
| 161 | + -f ${dictionaryFile} |
| 162 | + -inlineInputHeader |
| 163 | + -noGlobalUsingStd |
| 164 | + -failOnWarnings |
| 165 | + -rmf ${rootmapFile} |
| 166 | + -rml $<TARGET_FILE_NAME:${target}> |
| 167 | + -I$<JOIN:${includeDirs},$<SEMICOLON>-I> |
149 | 168 | $<$<BOOL:${prop}>:-D$<JOIN:${prop},$<SEMICOLON>-D>> |
150 | | - $<$<BOOL:${hasExtraPatch}>:--extra-patch> |
151 | | - $<$<BOOL:${hasExtraPatch}>:${CMAKE_CURRENT_LIST_DIR}/${A_EXTRA_PATCH}> |
152 | | - --pcmdeps "$<REMOVE_DUPLICATES:$<TARGET_PROPERTY:${target},O2_PCM_DEPS>>" |
153 | | - --headers "${headers}" |
| 169 | + $<$<BOOL:${pcmDeps}>:-m$<SEMICOLON>$<JOIN:${pcmDeps},$<SEMICOLON>-m$<SEMICOLON>>> |
| 170 | + ${headers} |
| 171 | + ${extraPatchCommand} |
154 | 172 | COMMAND |
155 | 173 | ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${pcmBase} ${pcmFile} |
156 | 174 | DEPENDS ${headers} "$<REMOVE_DUPLICATES:$<TARGET_PROPERTY:${target},O2_PCM_DEPS>>" ${A_EXTRA_PATCH}) |
|
0 commit comments