[11197] Allow of std malloc use instead of TBB

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
cipherCOM 2011-02-22 19:54:48 +03:00 committed by VladimirMangos
parent fd39a2bdb9
commit f9c184b097
3 changed files with 22 additions and 16 deletions

View file

@ -101,6 +101,7 @@ option(DEBUG "Debug mode" 0)
# option(CLI "With CLI" 1) # Not used by MaNGOS so far
# option(RA "With Remote Access" 0) # TODO: support remote access
option(TBB_USE_EXTERNAL "Use external TBB" 0)
option(USE_STD_MALLOC "Use standard malloc instead of TBB" 0)
option(ACE_USE_EXTERNAL "Use external ACE" 0)
find_package(PCHSupport)
@ -167,21 +168,23 @@ else()
include(cmake/ImportACE.cmake)
endif()
unset(TBB_INCLUDE_DIR CACHE)
unset(TBB_LIBRARIES CACHE)
unset(TBB_LIBRARIES_DIR CACHE)
unset(TBB_INCLUDE_DIR)
unset(TBB_LIBRARIES)
unset(TBB_LIBRARIES_DIR)
if(TBB_USE_EXTERNAL)
find_package(TBB)
if(NOT TBB_FOUND)
message(FATAL_ERROR
"This project requires TBB installed when TBB_USE_EXTERNAL is set. Please download the TBB Stable Release from http://www.threadingbuildingblocks.org/ and install it. If this script didn't find TBB and it was correctly installed please set TBB_ROOT to the correct path."
)
if(NOT USE_STD_MALLOC)
unset(TBB_INCLUDE_DIR CACHE)
unset(TBB_LIBRARIES CACHE)
unset(TBB_LIBRARIES_DIR CACHE)
unset(TBB_INCLUDE_DIR)
unset(TBB_LIBRARIES)
unset(TBB_LIBRARIES_DIR)
if(TBB_USE_EXTERNAL)
find_package(TBB)
if(NOT TBB_FOUND)
message(FATAL_ERROR
"This project requires TBB installed when TBB_USE_EXTERNAL is set. Please download the TBB Stable Release from http://www.threadingbuildingblocks.org/ and install it. If this script didn't find TBB and it was correctly installed please set TBB_ROOT to the correct path."
)
endif()
else()
include(cmake/ImportTBB.cmake)
endif()
else()
include(cmake/ImportTBB.cmake)
endif()
# Win32 delifered packages
@ -416,6 +419,9 @@ if(WIN32)
set(DEFINITIONS ${DEFINITIONS} WIN32 _WIN32)
set(DEFINITIONS_RELEASE ${DEFINITIONS_RELEASE} _CRT_SECURE_NO_WARNINGS)
endif()
if(USE_STD_MALLOC)
set(DEFINITIONS ${DEFINITIONS} USE_STANDARD_MALLOC)
endif()
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}")
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_RELEASE "${DEFINITIONS_RELEASE}")

View file

@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
if(NOT TBB_USE_EXTERNAL)
if(NOT (TBB_USE_EXTERNAL OR USE_STD_MALLOC))
add_subdirectory(tbb)
endif()

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11196"
#define REVISION_NR "11197"
#endif // __REVISION_NR_H__