mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
* Common code extracted to Python directories. * Read ~/.scons file for scons environment defaults. * Override scons settings with shell environment variables. * New "tags" for debug, nodebug, optimize, nooptimize builds. * Universal platform detection. * Default value of environment variables set through prefix dictionaries. * Check for correct Boost value and fail otherwise. * Extract git describe --tags into a preprocesor variable, -DTIP_BRANCH * More colors - blue for unchanged defaults, green for changed defaults, red for error. * Contain unit tests for non-obvious stuff. * Check to see that boost libraries have been built. * Right now, we accept both .dylib and .a versions but it'd be easy to enforce .a only.
49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
|
|
import copy
|
|
import os
|
|
import sys
|
|
|
|
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)
|
|
|
|
add_beast_to_path()
|
|
|
|
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
|
|
|
|
VARIANT_DIRECTORIES = {
|
|
'beast': ('bin', 'beast'),
|
|
'modules': ('bin', 'modules'),
|
|
}
|
|
|
|
BOOST_LIBRARIES = 'boost_system',
|
|
MAIN_PROGRAM_FILE = 'beast/unit_test/tests/main.cpp'
|
|
DOTFILE = '~/.scons'
|
|
|
|
def main():
|
|
File.validate_libraries(Boost.LIBPATH, BOOST_LIBRARIES)
|
|
defaults = GetEnvironment.get_environment(ARGUMENTS)
|
|
working = copy.deepcopy(defaults)
|
|
add_common_flags(defaults)
|
|
|
|
add_user_env(working, DOTFILE)
|
|
add_common_flags(working)
|
|
Print.print_build_config(working, defaults)
|
|
|
|
env = Environment(**working)
|
|
|
|
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')
|
|
|
|
main()
|