From b9ccbcd2dd85fe49e22f7fdfbbc92300757d99ef Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 12 Sep 2015 00:47:10 -0400 Subject: [PATCH] scons: Add some basic configure checks for Boost/SFML/zlib --- SConstruct | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 9fcff67d6..f43f8bb2a 100644 --- a/SConstruct +++ b/SConstruct @@ -39,11 +39,8 @@ else: echo -e "\n#define GIT_REVISION \"\"\n#define GIT_TAG \"\"\n#define GIT_TAG_REVISION \"\"\n" > #TARGET """) -env.Append(CONFIGUREDIR='#build/conf', CONFIGURELOG='#build/conf/config.log') -# We don't run any configuration tests yet, but we probably will eventually - if str(platform) == "darwin": - env.Append(CPPFLAGS="-std=c++11 -stdlib=libc++") + env.Append(CXXFLAGS="-std=c++11 -stdlib=libc++") env["CC"] = 'clang' env["CXX"] = 'clang++' env.Append(BUILDERS={ @@ -68,6 +65,40 @@ elif str(platform) == "windows": env.AddMethod(build_app_package, "Package") +env['CONFIGUREDIR'] = '#build/conf' +env['CONFIGURELOG'] = '#build/conf/config.log' +conf = Configure(env) + +if not conf.CheckLib('z'): + print 'zlib must be installed!' + Exit(1) + +def check_lib(lib, disp): + if not conf.CheckLib(lib, language='C++', autoadd=False): + print disp, 'must be installed!' + Exit(1) + +def check_header(header, disp): + if not conf.CheckCXXHeader(header, '<>'): + print disp, 'must be installed!' + Exit(1) + +check_header('boost/lexical_cast.hpp', 'Boost.LexicalCast') +check_header('boost/optional.hpp', 'Boost.Optional') +check_header('boost/ptr_container/ptr_container.hpp', 'Boost.PointerContainer') +check_header('boost/any.hpp', 'Boost.Any') +check_header('boost/math_fwd.hpp', 'Boost.Math') +check_header('boost/spirit/include/classic.hpp', 'Boost.Spirit.Classic') +check_lib('boost_system', 'Boost.System') +check_lib('boost_filesystem', 'Boost.Filesystem') +check_lib('boost_thread', 'Boost.Thread') +check_lib('sfml-system', 'SFML-system') +check_lib('sfml-window', 'SFML-window') +check_lib('sfml-audio', 'SFML-audio') +check_lib('sfml-graphics', 'SFML-graphics') + +env = conf.Finish() + env.Append(CPPDEFINES="TIXML_USE_TICPP") # Include directories @@ -94,7 +125,7 @@ bundled_libs = Split(""" sfml-window """) -env.Append(LIBS = bundled_libs + ["z"]) +env.Append(LIBS = bundled_libs) if str(platform) == "darwin": env.Append(LIBS=Split("""