# This file is in the public domain
libanastasisredux_SOURCES = [
    'anastasis_api_discovery.c',
    'anastasis_api_providers.c',
    'anastasis_api_redux.c',
    'anastasis_api_redux_state.c',
    'anastasis_api_redux_parse.c',
    'anastasis_api_redux_serialize.c',
    'anastasis_api_redux_free.c',
    'anastasis_api_recovery_redux.c',
    'anastasis_api_backup_redux.c',
    'validation.c',
    'validation_BE_NRN.c',
    'validation_CH_AHV.c',
    'validation_CZ_BN.c',
    'validation_DE_SVN.c',
    'validation_DE_TIN.c',
    'validation_ES_DNI.c',
    'validation_FR_INSEE.c',
    'validation_IN_AADHAR.c',
    'validation_IT_CF.c',
    'validation_NL_BSN.c',
    'validation_XX_SQUARE.c',
    'validation_XY_PRIME.c',
]

libanastasisredux = library(
    'anastasisredux',
    libanastasisredux_SOURCES,
    soversion: solibversions['libanastasisredux']['soversion'],
    version: solibversions['libanastasisredux']['soversion'],
    install_rpath: rpath_option,
    dependencies: [
        gnunetutil_dep,
        gnunetjson_dep,
        gnunetcurl_dep,
        talermhd_dep,
        talerutil_dep,
        talerexchange_dep,
        talermerchant_dep,
        talerjson_dep,
        json_dep,
        gcrypt_dep,
        m_dep,
        libanastasisutil_dep,
        libanastasisrest_dep,
        libanastasis_dep,
    ],
    include_directories: [incdir, configuration_inc],
    install: true,
    install_dir: get_option('libdir'),
)

test_redux_codec = executable(
    'test_redux_codec',
    ['test_redux_codec.c'],
    dependencies: [
        gnunetutil_dep,
        gnunetjson_dep,
        gnunetcurl_dep,
        talerutil_dep,
        talerjson_dep,
        json_dep,
        libanastasisutil_dep,
        libanastasis_dep,
        declare_dependency(link_with: libanastasisredux),
    ],
    include_directories: [incdir, configuration_inc],
    build_by_default: false,
    install: false,
)
test(
    'test_redux_codec',
    test_redux_codec,
    env: {'ANASTASIS_CLI_SRCDIR': meson.project_source_root() / 'src' / 'cli'},
    suite: ['reducer'],
)

test_validation = executable(
    'test_validation',
    ['test_validation.c'],
    dependencies: [
        gnunetutil_dep,
        json_dep,
        declare_dependency(link_with: libanastasisredux),
    ],
    include_directories: [incdir, configuration_inc],
    build_by_default: false,
    install: false,
)
test('test_validation', test_validation, suite: ['reducer'])

libanastasisredux_dep = declare_dependency(link_with: libanastasisredux)
pkg.generate(
    libanastasisredux,
    url: 'https://taler.net',
    description: 'GNU Taler anastasis redux library',
)


