diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 5f9f529e5b6d9..6d0b6ce6888ae 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -830,9 +830,6 @@ endfunction() function(ROOT_LINKER_LIBRARY library) CMAKE_PARSE_ARGUMENTS(ARG "DLLEXPORT;CMAKENOEXPORT;TEST;NOINSTALL" "TYPE" "LIBRARIES;DEPENDENCIES;BUILTINS" ${ARGN}) ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS}) - if(NOT ARG_TYPE) - set(ARG_TYPE SHARED) - endif() if(ARG_TEST) # we are building a test, so add EXCLUDE_FROM_ALL set(_all EXCLUDE_FROM_ALL) endif() @@ -851,6 +848,7 @@ function(ROOT_LINKER_LIBRARY library) set_target_properties(${library} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) else() add_library( ${library} ${_all} ${ARG_TYPE} ${lib_srcs}) + set_target_properties(${library} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) if(ARG_TYPE STREQUAL SHARED) set_target_properties(${library} PROPERTIES ${ROOT_LIBRARY_PROPERTIES} ) endif() diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index eb50113ebb80c..a7e539f04d630 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -156,7 +156,7 @@ endif() add_subdirectory(rootcling_stage1) #------------------------------------------------------------------------------- -ROOT_LINKER_LIBRARY(Core $ ${objectlibs} BUILTINS LZMA) +ROOT_LINKER_LIBRARY(Core SHARED $ ${objectlibs} BUILTINS LZMA) if (libcxx AND NOT APPLE) # In case we use libcxx and glibc together there is a mismatch of the @@ -243,9 +243,10 @@ target_link_libraries(Core LZ4::LZ4 ZLIB::ZLIB ${ZSTD_LIBRARIES} - ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${corelinklibs} + PUBLIC + ${CMAKE_DL_LIBS} ) add_dependencies(Core CLING) diff --git a/core/metacling/src/CMakeLists.txt b/core/metacling/src/CMakeLists.txt index 2923345f7cb84..0462a3cdaa07d 100644 --- a/core/metacling/src/CMakeLists.txt +++ b/core/metacling/src/CMakeLists.txt @@ -108,7 +108,7 @@ if (clad) endif() endif() -ROOT_LINKER_LIBRARY(Cling +ROOT_LINKER_LIBRARY(Cling SHARED $ $ $ diff --git a/io/io/CMakeLists.txt b/io/io/CMakeLists.txt index eea2ee9fb0cb2..c632fab8f625f 100644 --- a/io/io/CMakeLists.txt +++ b/io/io/CMakeLists.txt @@ -16,7 +16,7 @@ else () set(rawfile_local_sources src/RRawFileUnix.cxx) endif () -ROOT_LINKER_LIBRARY(RIO +ROOT_LINKER_LIBRARY(RIO SHARED src/RRawFile.cxx ${rawfile_local_sources} src/TArchiveFile.cxx diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 73443931010ae..cd73a68d356e5 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -17,7 +17,78 @@ if(NOT WIN32) ROOT_EXECUTABLE(roots.exe roots.cxx LIBRARIES Core MathCore) ROOT_EXECUTABLE(xpdtest xpdtest.cxx LIBRARIES Proof Tree Hist RIO Net Thread Matrix MathCore) endif() -ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core Rint) +ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES + Core RIO freetype + -Wl,--whole-archive + Rint + Tree + Hist + HistPainter + MathCore + Gpad + -Wl,--no-whole-archive + EG + FitPanel + Foam + Fumili + Ged + GenVector + Geom + GeomBuilder + GeomPainter + Gpad + Graf + Graf3d + Gui + GuiBld + GuiHtml + Hist + HistPainter + Html + Imt + MathCore + Matrix + Minuit + MultiProc + Net + New + Physics + Postscript + Proof + ProofBench + ProofDraw + ProofPlayer + Quadp + RCsg + ROOTVecOps + Recorder + RootAuth + SPlot + SQLIO + SessionViewer + Smatrix + Tree + TreePlayer + TreeViewer + XMLIO + complexDict + dequeDict + forward_listDict + listDict + map2Dict + mapDict + mathtext + multimap2Dict + multimapDict + multisetDict + setDict + unordered_mapDict + unordered_multimapDict + unordered_multisetDict + unordered_setDict + valarrayDict + vectorDict +) if(MSVC) set(root_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch /EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index diff --git a/net/auth/CMakeLists.txt b/net/auth/CMakeLists.txt index eee65f3736c42..f864eea9bd5d2 100644 --- a/net/auth/CMakeLists.txt +++ b/net/auth/CMakeLists.txt @@ -32,4 +32,4 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RootAuth RIO ) -target_link_libraries(RootAuth PRIVATE rsa $<$:crypt>) +target_link_libraries(RootAuth PRIVATE $ $<$:crypt>)