diff --git a/CMakeLists.txt b/CMakeLists.txt index c3e56e2e0..495b27a90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index c4e9cc11f..86b0597c3 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -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() diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5b27afd39..d8562b666 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11196" + #define REVISION_NR "11197" #endif // __REVISION_NR_H__