"""Build rdb tests"""


def scons():
    """Execute build"""
    Import('denv', 'libdaos_tgts')

    tenv = denv.Clone()
    tenv.require('isal')

    # rdbt server
    librdbt = tenv.d_library('rdbt', ['rdb_test.c', 'rpc.c'], install_off='../..')
    tenv.Install('$PREFIX/lib64/daos_srv', librdbt)

    # rdbt client
    rdbt = tenv.d_program('rdbt', ['rdbt.c', 'rpc.c'] + libdaos_tgts,
                          LIBS=['daos_common_pmem', 'cart', 'gurt', 'uuid', 'isal', 'protobuf-c',
                                'pthread'])
    tenv.Install('$PREFIX/bin', rdbt)


if __name__ == "SCons.Script":
    scons()
