Skip to content

Commit e63a621

Browse files
committed
[core] Link libCling against libCore
... as it was already done on Windows: It uses some symbols and this allows to remove some bad linker options.
1 parent b1dce56 commit e63a621

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/metacling/src/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ ROOT_LINKER_LIBRARY(Cling
130130
$<TARGET_OBJECTS:clangCppInterOp>
131131
LIBRARIES ${CLING_LIBRARIES} ${LINK_LIBS} ${CLING_PLUGIN_LINK_LIBS})
132132

133+
target_link_libraries(Cling PRIVATE Core RIO)
134+
133135
# When these two link at the same time, they can exhaust the RAM on many machines, since they both link against llvm.
134136
add_dependencies(Cling rootcling_stage1)
135137

@@ -217,14 +219,11 @@ if(MSVC)
217219
set(cling_link_str "${cling_link_str} /EXPORT:${sym}")
218220
endforeach(sym ${cling_exports})
219221
set_property(TARGET Cling APPEND_STRING PROPERTY LINK_FLAGS "${cling_link_str} ${CLAD_LIBS}")
220-
add_dependencies(Cling Core RIO)
221-
target_link_libraries(Cling PUBLIC Core RIO)
222222
endif()
223223

224224
if(APPLE)
225-
target_link_libraries(Cling PUBLIC -Wl,-w -Wl,-bind_at_load -Wl,-undefined,dynamic_lookup)
225+
target_link_libraries(Cling PUBLIC -Wl,-w -Wl,-bind_at_load)
226226
elseif(NOT MSVC)
227-
target_link_libraries(Cling PUBLIC -Wl,--unresolved-symbols=ignore-in-object-files)
228227
# Require the linker to resolve the symbol internally and prevent
229228
# conflicts when linked with another software using also LLVM like in
230229
# the problem reported for Julia in

0 commit comments

Comments
 (0)