Fixup boost filesystem options for cmake, scons

The option should control the compilation, in wesnoth-core, of
filesystem_boost.cpp, and gettext_boost.cpp, vs. the old versions.

Using the new code is now the default option, you must explicitly
deactivate with both cmake and scons to get the old stuff back.
This commit is contained in:
Chris Beck 2014-10-25 17:14:30 -04:00
parent e723de7be3
commit bdd109ebcb
6 changed files with 27 additions and 8 deletions

View file

@ -85,6 +85,7 @@ option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF)
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
option(ENABLE_PANDORA "Add support for the OpenPandora by deactivating libvorbis support" OFF)
option(ENABLE_SDL_GPU "Enable building with SDL_gpu (experimental" OFF)
option(ENABLE_BOOST_FILESYSTEM "Enable building with the boost filesystem and boost locale code" ON)
if(NOT DEFINED ENABLE_DISPLAY_REVISION)
# Test whether the code is used in a repository if not autorevision will
@ -586,6 +587,11 @@ if(ENABLE_GAME)
endif(LIBDBUS_FOUND)
endif(ENABLE_NOTIFICATIONS)
if(ENABLE_BOOST_FILESYSTEM)
find_package( Boost 1.44 REQUIRED COMPONENTS filesystem )
find_package( Boost 1.48 REQUIRED COMPONENTS locale )
endif(ENABLE_BOOST_FILESYSTEM)
endif(ENABLE_GAME)
if(ENABLE_POT_UPDATE_TARGET)

View file

@ -369,8 +369,9 @@ if env["prereqs"]:
conf.CheckBoostIostreamsBZip2() & \
conf.CheckBoost("smart_ptr", header_only = True) & \
conf.CheckBoost("system") & \
((not env["boostfilesystem"]) or (conf.CheckBoost("filesystem", require_version = "1.44.0"))) & \
((not env["PLATFORM"] == "win32") or (not env["boostfilesystem"]) or (conf.CheckBoost("locale"))) \
((not env["boostfilesystem"]) or
(conf.CheckBoost("filesystem", require_version = "1.44.0") & \
conf.CheckBoost("locale"))) \
and Info("GOOD: Base prerequisites are met")) \
or Warning("WARN: Base prerequisites are not met")

View file

@ -209,10 +209,8 @@ endif(ENABLE_SHARED_LIBRARIES)
set(libwesnoth-core_STAT_SRC
color_range.cpp
config.cpp
filesystem.cpp
filesystem_common.cpp
game_config.cpp
gettext.cpp
hash.cpp
log.cpp
md5.cpp
@ -229,6 +227,20 @@ set(libwesnoth-core_STAT_SRC
serialization/validator.cpp
)
if(ENABLE_BOOST_FILESYSTEM)
set(libwesnoth-core_STAT_SRC
${libwesnoth-core_STAT_SRC}
filesystem_boost.cpp
gettext_boost.cpp
)
else(ENABLE_BOOST_FILESYSTEM)
set(libwesnoth-core_STAT_SRC
${libwesnoth-game_STAT_SRC}
filesystem.cpp
gettext.cpp
)
endif(ENABLE_BOOST_FILESYSTEM)
# 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 ${LIBRARY_TYPE} EXCLUDE_FROM_ALL ${libwesnoth-core_STAT_SRC})

View file

@ -16,7 +16,6 @@ for env in [test_env, client_env, env]:
libwesnoth_core_sources = Split("""
color_range.cpp
config.cpp
gettext.cpp
hash.cpp
log.cpp
map.cpp
@ -64,7 +63,8 @@ if env['default_prefs_file']:
libwesnoth_core_sources.extend([
game_config_env.Object("game_config.cpp"),
filesystem_env.Object("filesystem_common.cpp"),
filesystem_env.Object("filesystem_boost.cpp") if env["boostfilesystem"] else filesystem_env.Object("filesystem.cpp")
filesystem_env.Object("filesystem_boost.cpp") if env["boostfilesystem"] else filesystem_env.Object("filesystem.cpp"),
filesystem_env.Object("gettext_boost.cpp") if env["boostfilesystem"] else filesystem_env.Object("gettext.cpp")
])
libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources)]

View file

@ -88,7 +88,7 @@ std::string dsngettext (const char * domainname, const char *singular, const cha
return msgval;
}
void bind_textdomain(const char* domain, const char* direcory, const char* encoding)
void bind_textdomain(const char* domain, const char* direcory, const char* /*encoding*/)
{
std::cerr << "adding textdomain '" << domain << "' in directory '" << direcory << "'\n";
get_manager().generator_.add_messages_domain(domain);

View file

@ -29,7 +29,7 @@
#ifdef _WIN32
#include <windows.h>
#ifndef _MSC_VER
#if !defined(_MSC_VER) && !defined(__MINGW32__)
extern "C" int _putenv(const char*);
#endif
#endif