subdirs = [ 'algorithm' ]

def configure(conf):
  conf.recurse(subdirs)

def build(bld):
  bld.install_files('${HPREFIX}/lang', [
      'cast.h',
      'bind.h', 'bind_mf.h', 'bind_template.h',
      'demangle.h',
      'mem_fn.h', 'mem_fn_def.h', 'mem_fn_cc.h', 'mem_fn_tmpl.h',
      'function.h',
      'noncopyable.h',
      'ref.h',
      'safe_bool.h',
      'scoped_ptr.h',
      'shared_ptr.h',
      'enable_shared_from_this.h',
      'weak_ptr.h',
      'singleton.h',
      'exception.h',
      'any.h',
      'util.h',
      'enable_if.h'
      ])

  bld.shlib(
    source = 'empty.cpp',
    vnum = bld.env['VERSION'],
    target = 'pficommon_lang')

  bld.program(
    features = 'gtest',
    source = 'bind_test.cpp',
    target = 'bind_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'demangle_test.cpp',
    target = 'demangle_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'include_test.cpp',
    target = 'include_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'instantiation_test.cpp',
    target = 'instantiation_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'shared_ptr_test.cpp',
    target = 'shared_ptr_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'ref_test.cpp',
    target = 'ref_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'function_test.cpp',
    target = 'function_test',
    includes = '.')

  bld.program(
    features = 'gtest',
    source = 'enable_if_test.cpp',
    target = 'enable_if_test',
    includes = '.')

  bld.recurse(subdirs)
