Files
boost_beast/SConstruct
T

48 lines
1.3 KiB
Python
Raw Normal View History

2014-04-09 15:33:34 -04:00
from __future__ import absolute_import, division, print_function, unicode_literals
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
import copy
2014-03-24 09:26:55 -07:00
import os
import sys
2014-04-09 15:33:34 -04:00
def add_beast_to_path():
python_home = os.path.join(os.getcwd(), 'python')
if python_home not in sys.path:
sys.path.append(python_home)
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
add_beast_to_path()
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
from beast.env.AddCommonFlags import add_common_flags
from beast.env.AddUserEnv import add_user_env
from beast.env import Print
from beast.platform import GetEnvironment
from beast.util import Boost
from beast.util import File
from beast.util import Tests
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
VARIANT_DIRECTORIES = {
'beast': ('bin', 'beast'),
'modules': ('bin', 'modules'),
}
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
BOOST_LIBRARIES = 'boost_system',
MAIN_PROGRAM_FILE = 'beast/unit_test/tests/main.cpp'
DOTFILE = '~/.scons'
2014-03-24 09:26:55 -07:00
def main():
2014-04-09 15:33:34 -04:00
File.validate_libraries(Boost.LIBPATH, BOOST_LIBRARIES)
defaults = GetEnvironment.get_environment(ARGUMENTS)
working = copy.deepcopy(defaults)
add_common_flags(defaults)
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
add_user_env(working, DOTFILE)
add_common_flags(working)
Print.print_build_config(working, defaults)
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
env = Environment(**working)
2014-03-24 09:26:55 -07:00
2014-04-09 15:33:34 -04:00
for name, path in VARIANT_DIRECTORIES.items():
env.VariantDir(os.path.join(*path), name, duplicate=0)
env.Replace(PRINT_CMD_LINE_FUNC=Print.print_cmd_line)
Tests.run_tests(env, MAIN_PROGRAM_FILE, '.', '.test.cpp')
2014-03-24 09:26:55 -07:00
main()