# -*- python -*-
def options(opt):
  pass

def configure(conf):
  pass

def build(bld):
  source = [
      'exception.cpp',
      'key_manager.cpp',
      'thread_pool.cpp',
      'vector_util.cpp',
      'version.cpp',
      'jsonconfig/config.cpp',
      'jsonconfig/exception.cpp',
      ]

  headers = [
      'assoc_vector.hpp',
      'assert.hpp',
      'big_endian.hpp',
      'byte_buffer.hpp',
      'exception.hpp',
      'exception_info.hpp',
      'hash.hpp',
      'jsonconfig.hpp',
      'key_manager.hpp',
      'lru.hpp',
      'thread_pool.hpp',
      'type.hpp',
      'unordered_map.hpp',
      'unordered_set.hpp',
      'vector_util.hpp',
      'version.hpp',
      'jsonconfig/cast.hpp',
      'jsonconfig/config.hpp',
      'jsonconfig/exception.hpp',
      ]
  use = ['jubatus_util']

  bld.core_sources.extend(bld.add_prefix(source))
  bld.core_headers.extend(bld.add_prefix(headers))
  bld.core_use.extend(use)

  test_src = [
    'assoc_vector_test.cpp',
    'exception_test.cpp',
    'big_endian_test.cpp',
    'byte_buffer_test.cpp',
    'key_manager_test.cpp',
    'lru_test.cpp',
    'vector_util_test.cpp',
    'jsonconfig_test.cpp',
    'version_test.cpp',
    ]

  def make_test(s):
    bld.program(
      features = 'gtest',
      source = s,
      target = s[0:s.rfind('.')],
      includes = '.',
      use = ['jubatus_util', 'jubatus_core']
      )
  for s in test_src:
    make_test(s)
