Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ROOT-6446 Changes to allow building (almost) static ROOT #5921

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions cmake/modules/RootMacros.cmake
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions core/CMakeLists.txt
Expand Up @@ -156,7 +156,7 @@ endif()
add_subdirectory(rootcling_stage1)

#-------------------------------------------------------------------------------
ROOT_LINKER_LIBRARY(Core $<TARGET_OBJECTS:BaseTROOT> ${objectlibs} BUILTINS LZMA)
ROOT_LINKER_LIBRARY(Core SHARED $<TARGET_OBJECTS:BaseTROOT> ${objectlibs} BUILTINS LZMA)

if (libcxx AND NOT APPLE)
# In case we use libcxx and glibc together there is a mismatch of the
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion core/metacling/src/CMakeLists.txt
Expand Up @@ -108,7 +108,7 @@ if (clad)
endif()
endif()

ROOT_LINKER_LIBRARY(Cling
ROOT_LINKER_LIBRARY(Cling SHARED
$<TARGET_OBJECTS:ClingUtils>
$<TARGET_OBJECTS:Dictgen>
$<TARGET_OBJECTS:MetaCling>
Expand Down
2 changes: 1 addition & 1 deletion io/io/CMakeLists.txt
Expand Up @@ -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
Expand Down
73 changes: 72 additions & 1 deletion main/CMakeLists.txt
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion net/auth/CMakeLists.txt
Expand Up @@ -32,4 +32,4 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RootAuth
RIO
)

target_link_libraries(RootAuth PRIVATE rsa $<$<PLATFORM_ID:Linux>:crypt>)
target_link_libraries(RootAuth PRIVATE $<LINK_ONLY:rsa> $<$<PLATFORM_ID:Linux>:crypt>)