# -*- mode: python -*-

Import("env use_system_version_of_library windows")

# TODO: Remove this and use CheckLib in its normal mechanism
if use_system_version_of_library("boost"):
    if windows:
        # On Windows, we use the autolib feature of boost to link in the
        # libraries we need, so we can't use SCons to detect them at configure time.
        env.Library("shim_boost", ['shim_boost.cpp'])
    else:
        env.Library("shim_boost", ['shim_boost.cpp'],
                    SYSLIBDEPS=[
                        env['LIBDEPS_BOOST_PROGRAM_OPTIONS_SYSLIBDEP'],
                        env['LIBDEPS_BOOST_FILESYSTEM_SYSLIBDEP'],
                        env['LIBDEPS_BOOST_THREAD_SYSLIBDEP'],
                        env['LIBDEPS_BOOST_SYSTEM_SYSLIBDEP']
                    ] )
else:
    print("Error: You must use --use-system-boost when building the C++ driver")
    Exit(1)

env.SConscript('gtest-1.7.0/SConscript')
