Skip to content
Snippets Groups Projects
Commit bce17d0f authored by Philippe Canal's avatar Philippe Canal
Browse files

From Pere:

For ROOT's Makefile we have intentionally disentangled CINT and dictionaries
by using order dependencies: when CINT gets changed, none of the dictionaries
get rebuilt, unless cint/cint/inc/cintdictversion.h is touched. This allows us
to maintain CINT without pain from the build system - in almost 100% of all
cases the dictionaries are unchanged after patching CINT. The difference is
drastic: 8 seconds (Makefile) compared to more than 5 minutes (CMake).

This change apply the technique to CMake. It still re-links all the libraries since
they depend on libCint.so but the time has been reduced from 7-8 minutes to
about 14 seconds on my Mac.


git-svn-id: http://root.cern.ch/svn/root/trunk@42930 27541ba8-7e3a-0410-8455-c3a389f83636
parent 9fd07f6a
Branches
Tags
No related merge requests found
......@@ -95,7 +95,7 @@ foreach(_name ${CINTSTLDLLNAMES})
add_Custom_Command(OUTPUT ${OutFileName}
COMMAND cint_tmp -w1 -z${_name} -n${OutFileName} ${AdditionalFlags} -D__MAKECINT__ -DG__MAKECINT ${IncludeDirs} -c-1 -A -Z0 ${InFileName} ${AdditionalHeaderFiles}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS cint_tmp
DEPENDS ${CINTDEP}
)
list(FIND CINTBUILDLOADER ${_name} _position)
......@@ -119,7 +119,20 @@ foreach(_name ${CINTSTLDLLNAMES})
endif()
set(linkdeffile "${CMAKE_SOURCE_DIR}/core/metautils/src/${_name}Linkdef.h")
ROOT_GENERATE_DICTIONARY( ${Dictionary} ${_name1} LINKDEF ${linkdeffile})
#ROOT_GENERATE_DICTIONARY( ${Dictionary} ${_name1} LINKDEF ${linkdeffile})
add_custom_command(OUTPUT ${Dictionary}.cxx ${Dictionary}.h
COMMAND rootcint_tmp -cint -f ${Dictionary}.cxx -c
-I${CMAKE_CURRENT_SOURCE_DIR}/inc
-I${CMAKE_BINARY_DIR}/include
-I${CMAKE_SOURCE_DIR}/cint/cint/include
-I${CMAKE_SOURCE_DIR}/cint/cint/stl
-I${CMAKE_SOURCE_DIR}/cint/cint/lib
-I${CMAKE_SOURCE_DIR}/core/base/inc
-I${CMAKE_SOURCE_DIR}/core/meta/inc
-I${CMAKE_SOURCE_DIR}/core/clib/inc
${_name1} ${linkdeffile}
DEPENDS ${linkdeffile} ${ROOTCINTDEP})
set_source_files_properties(${Dictionary}.cxx
COMPILE_FLAGS "${CINTDLLCXXFLAGS} -DG__CINTBODY -I${HEADER_OUTPUT_PATH}"
)
......@@ -161,7 +174,7 @@ foreach(_name ${CINTINCDLLNAMES})
add_custom_command(OUTPUT ${OutFileName}
COMMAND cint_tmp -K -w1 -z${_name} -n${OutFileName} -D__MAKECINT__ -DG__MAKECINT ${IncludeDirs} -c-2 -Z0 ${InFileName} ${AdditionalHeaderFiles}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS cint_tmp
DEPENDS ${CINTDEP}
)
set_source_files_properties(${OutFileName}
......@@ -178,7 +191,7 @@ foreach(_name ${CINTINCDLLNAMES})
add_custom_command(OUTPUT ${OutFileName}
COMMAND cint_tmp -K -w1 -z${_name} -n${OutFileName} -D__MAKECINT__ -DG__MAKECINT ${IncludeDirs} -c-2 -Z0 ${InFileName} ${AdditionalHeaderFiles}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h cint_tmp
DEPENDS ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h ${CINTDEP}
)
set_source_files_properties(${OutFileName}
......@@ -216,7 +229,7 @@ foreach(_name ${CINTINCDLLNAMES})
add_custom_command(OUTPUT ${OutFileName}
COMMAND cint_tmp -K -w1 -z${_name} -n${OutFileName} -D__MAKECINT__ -DG__MAKECINT ${_ExtraFlag} -c-2 -Z0 ${InFileName} ${AdditionalHeaderFiles} ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h ${CMAKE_SOURCE_DIR}/cint/cint/lib/posix/posix.h
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h cint_tmp
DEPENDS ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h ${CINTDEP}
)
set_source_files_properties(${OutFileName}
COMPILE_FLAGS "${CINT_C_DEFINITIONS} -DG__HAVE_CONFIG -DG__NOMAKEINFO -I${CMAKE_SOURCE_DIR}/cint/cint/inc -I${CMAKE_SOURCE_DIR}/cint/cint/src -I${CMAKE_SOURCE_DIR}/cint/cint/src/dict -DG__SYSTYPES_H"
......
......@@ -79,7 +79,7 @@ else()
COMMAND cint_tmp -I${CMAKE_CURRENT_SOURCE_DIR}/include
-I${CMAKE_CURRENT_SOURCE_DIR}/stl -I${CMAKE_CURRENT_SOURCE_DIR}/lib
-I${HEADER_OUTPUT_PATH} ${PROJECT_SOURCE_DIR}/cint/iosenum/iosenum.cxx
DEPENDS cint_tmp
DEPENDS ${CINTDEP}
)
endif()
......@@ -138,6 +138,9 @@ ROOT_EXECUTABLE(cint.exe ${CMAKE_CURRENT_SOURCE_DIR}/main/cppmain.cxx LIBRARIES
ROOT_EXECUTABLE(cint_tmp ${CMAKE_CURRENT_SOURCE_DIR}/main/cppmain.cxx
${CMAKE_CURRENT_BINARY_DIR}/loadfile_tmp.cxx LIBRARIES Cint_static ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
#---Trick to avoid building all dictionaties when CINT is changed-------------------------------------------
add_custom_target(CINTTARGET DEPENDS cint_tmp)
#---Create the makecint executable--------------------------------------------------------------------------
ROOT_EXECUTABLE(makecint ${CMAKE_SOURCE_DIR}/cint/tool/makecint.cxx LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
......
......@@ -63,6 +63,9 @@ else()
endif()
set(rlibmap_cmd rlibmap)
endif()
#---Dictionary dependencies to ${CMAKE_SOURCE_DIR}/cint/cint/inc/cintdictversion.h and rootcint executable
set(ROOTCINTDEP ${CMAKE_SOURCE_DIR}/cint/cint/inc/cintdictversion.h ROOTCINTTARGET)
set(CINTDEP ${CMAKE_SOURCE_DIR}/cint/cint/inc/cintdictversion.h CINTTARGET)
set(CMAKE_VERBOSE_MAKEFILES OFF)
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
......@@ -210,7 +213,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h
COMMAND ${rootcint_cmd} -cint -f ${dictionary}.cxx
-c ${ARG_OPTIONS} ${definitions} ${includedirs} ${rheaderfiles} ${_linkdef}
DEPENDS ${headerfiles} ${_linkdef} rootcint)
DEPENDS ${headerfiles} ${_linkdef} ${ROOTCINTDEP})
endfunction()
......
......@@ -29,6 +29,9 @@ ROOT_EXECUTABLE(rootcint_tmp rootcint_tmp.cxx RStl_tmp.cxx loadfile_tmp.cxx
LIBRARIES Cint_static ${CMAKE_DL_LIBS})
add_dependencies(rootcint_tmp IOSENUM_H)
#---Trick to avoid building all dictionaties when CINT is changed-------------
add_custom_target(ROOTCINTTARGET DEPENDS rootcint rootcint_tmp)
#---rlibmap executable--------------------------------------------------------
ROOT_EXECUTABLE(rlibmap rlibmap.cxx LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment