Skip to content

Commit

Permalink
Add filesystem_boost.cpp, a boost::filesystem implementation of files…
Browse files Browse the repository at this point in the history
…ystem.hpp
  • Loading branch information
AI0867 committed Nov 27, 2013
1 parent ecf8f3d commit 6f2c048
Show file tree
Hide file tree
Showing 4 changed files with 946 additions and 2 deletions.
9 changes: 8 additions & 1 deletion SConstruct
Expand Up @@ -73,6 +73,7 @@ opts.AddVariables(
BoolVariable('lowmem', 'Set to reduce memory usage by removing extra functionality', False),
BoolVariable('notifications', 'Enable support for desktop notifications', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
BoolVariable('boostfilesystem', 'Use boost filesystem', True),
PathVariable('prefix', 'autotools-style installation prefix', "/usr/local", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', "", PathVariable.PathAccept),
PathVariable('default_prefs_file', 'default preferences file name', "", PathVariable.PathAccept),
Expand Down Expand Up @@ -272,6 +273,10 @@ configure_args = dict(custom_tests = init_metasconf(env, ["cplusplus", "python_d
log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp")

env.MergeFlags(env["extra_flags_config"])

# Some tests need to load parts of boost
if env["boostfilesystem"]:
env.PrependENVPath('LD_LIBRARY_PATH', env["boostlibdir"])
if env["prereqs"]:
conf = env.Configure(**configure_args)

Expand Down Expand Up @@ -323,7 +328,9 @@ if env["prereqs"]:
conf.CheckBoostIostreamsBZip2() and \
conf.CheckBoost("smart_ptr", header_only = True) and \
conf.CheckSDL(require_version = '1.2.7') and \
conf.CheckSDL('SDL_net') or Warning("Base prerequisites are not met.")
conf.CheckSDL('SDL_net') and \
conf.CheckBoost("system") and \
((not env["boostfilesystem"]) or (conf.CheckBoost("filesystem", require_version = "1.44.0"))) or Warning("Base prerequisites are not met.")

env = conf.Finish()
client_env = env.Clone()
Expand Down
1 change: 1 addition & 0 deletions scons/boost.py
Expand Up @@ -59,6 +59,7 @@ def CheckBoost(context, boost_lib, require_version = None, header_only = False):
boost_headers = { "regex" : "regex/config.hpp",
"iostreams" : "iostreams/constants.hpp",
"unit_test_framework" : "test/unit_test.hpp",
"filesystem" : "filesystem/operations.hpp",
"system" : "system/error_code.hpp"}

header_name = boost_headers.get(boost_lib, boost_lib + ".hpp")
Expand Down
2 changes: 1 addition & 1 deletion src/SConscript
Expand Up @@ -62,8 +62,8 @@ if env['default_prefs_file']:

libwesnoth_core_sources.extend([
game_config_env.Object("game_config.cpp"),
filesystem_env.Object("filesystem.cpp"),
filesystem_env.Object("filesystem_common.cpp"),
filesystem_env.Object("filesystem_boost.cpp") if env["boostfilesystem"] else filesystem_env.Object("filesystem.cpp")
])

libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources)]
Expand Down

0 comments on commit 6f2c048

Please sign in to comment.