add option to disable custom pool alloc in cmake recipe

deactivating the custom malloc seems to also fix some crashes...
This commit is contained in:
Nils Kneuper 2008-12-26 09:01:31 +00:00
parent ebb0ede7f4
commit 6a3e3815d2
2 changed files with 13 additions and 2 deletions

View file

@ -79,6 +79,7 @@ option(ENABLE_EDITOR "Enable compilation of the new map editor into the game exe
option(ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers")
option(ENABLE_TESTS "Build unit tests")
option(ENABLE_NLS "Enable building of tranlations" ON)
option(ENABLE_POOL_ALLOC "Enable custom pool malloc" ON)
set(BINARY_SUFFIX "" CACHE STRING "Suffix behind all binaries")
set(BINARY_PREFIX "" CACHE STRING "Prefix in front of all binaries")
@ -104,6 +105,10 @@ if(NOT WIN32)
add_definitions(-DWESNOTH_PATH='\"${DATADIR}\"')
endif(NOT WIN32)
if(NOT ENABLE_POOL_ALLOC OR WIN32)
add_definitions(-DDISABLE_POOL_ALLOC)
endif(NOT ENABLE_POOL_ALLOC OR WIN32)
if(NOT ENABLE_EDITOR)
add_definitions(-DDISABLE_EDITOR2)
endif(NOT ENABLE_EDITOR)

View file

@ -106,11 +106,9 @@ SET(libwesnoth-core_STAT_SRC
game_config.cpp
gettext.cpp
log.cpp
malloc.c
map.cpp
map_location.cpp
md5.cpp
poolalloc.c
thread.cpp
tstring.cpp
util.cpp
@ -124,6 +122,14 @@ SET(libwesnoth-core_STAT_SRC
${REVISION_FILE}
)
if(ENABLE_POOL_ALLOC AND NOT WIN32)
SET(libwesnoth-core_STAT_SRC
${libwesnoth-core_STAT_SRC}
malloc.c
poolalloc.c
)
endif(ENABLE_POOL_ALLOC AND NOT WIN32)
# a 'lib' is automatically set in front when creating the library (as in the filename)
# internal reference is the name given here
add_library(wesnoth-core STATIC EXCLUDE_FROM_ALL ${libwesnoth-core_STAT_SRC})