Skip to content
Snippets Groups Projects
Commit cceadad5 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Reactivate tcmalloc for release builds.

parent ccaa7a74
No related branches found
No related tags found
No related merge requests found
...@@ -61,13 +61,20 @@ set ( PYTHONW_EXECUTABLE "${PYTHON_DIR}/pythonw.exe" CACHE FILEPATH ...@@ -61,13 +61,20 @@ set ( PYTHONW_EXECUTABLE "${PYTHON_DIR}/pythonw.exe" CACHE FILEPATH
########################################################################### ###########################################################################
# If required, find tcmalloc # If required, find tcmalloc
########################################################################### ###########################################################################
set ( USE_TCMALLOC OFF CACHE BOOL "If true, link with tcmalloc" ) option ( USE_TCMALLOC "If true, link with tcmalloc" ON )
# If not wanted, just carry on without it # If not wanted, just carry on without it
if ( USE_TCMALLOC ) if ( USE_TCMALLOC )
set ( TCMALLOC_LIBRARIES optimized "${CMAKE_LIBRARY_PATH}/libtcmalloc_minimal.lib" debug "${CMAKE_LIBRARY_PATH}/libtcmalloc_minimal-debug.lib" ) # Only link in release configurations. There seems to be problem linking in debug mode
set ( TCMALLOC_LIBRARIES optimized "${CMAKE_LIBRARY_PATH}/libtcmalloc_minimal.lib" )
# Use an alternate variable name so that it is only set on Windows # Use an alternate variable name so that it is only set on Windows
set ( TCMALLOC_LIBRARIES_LINKTIME ${TCMALLOC_LIBRARIES}) set ( TCMALLOC_LIBRARIES_LINKTIME ${TCMALLOC_LIBRARIES})
set ( CMAKE_SHARED_LINKER_FLAGS /INCLUDE:"__tcmalloc" ) set ( _configs RELEASE RELWITHDEBINFO MINSIZEREL )
set ( _targets EXE SHARED )
foreach ( _tgt ${_targets})
foreach ( _cfg ${_configs})
set ( CMAKE_${_tgt}_LINKER_FLAGS_${_cfg} "${CMAKE_${_tgt}_LINKER_FLAGS_${_cfg}} /INCLUDE:__tcmalloc" )
endforeach ()
endforeach ()
else ( USE_TCMALLOC ) else ( USE_TCMALLOC )
message ( STATUS "TCMalloc will not be included." ) message ( STATUS "TCMalloc will not be included." )
endif () endif ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment