#!/usr/bin/env python
from waflib.extras import autowaf as autowaf

def build(bld):
    obj = bld(features        = 'c cshlib cxx cxxshlib',
              source          = ['Parser.cpp',
                                 'Serialiser.cpp',
                                 'serialisation.cpp'],
              export_includes = ['../..'],
              includes        = ['.', '../..'],
              name            = 'libingen_serialisation',
              target          = 'ingen_serialisation',
              install_path    = '${LIBDIR}',
              use             = 'libingen')
    autowaf.use_lib(bld, obj, 'GLIBMM LV2 LILV RAUL SERD SORD SRATOM')

    if bld.env.BUILD_TESTS:
        obj = bld(features        = 'c cshlib cxx cxxshlib',
                  source          = ['Parser.cpp',
                                     'Serialiser.cpp',
                                     'serialisation.cpp'],
                  export_includes = ['../..'],
                  includes        = ['.', '../..'],
                  name            = 'libingen_serialisation_profiled',
                  target          = 'ingen_serialisation_profiled',
                  install_path    = '',
                  use             = 'libingen_profiled',
                  lib             = bld.env.INGEN_TEST_LIBS,
                  cxxflags        = bld.env.INGEN_TEST_CXXFLAGS)
        autowaf.use_lib(bld, obj, 'GLIBMM LV2 LILV RAUL SERD SORD SRATOM')