# examples.thrift

load_module('craftr.lang.cxx.*')
load_module('craftr.lang.thrift.*')

thriftfiles = thrift_gen(
  inputs = [local('tutorial.thrift')],
  gen = ['cpp:pure_enums,movable_types', 'py:new_style,utf8strings'],
)

sources = [
  'thrift/Calculator.cpp',
  'thrift/tutorial_constants.cpp',
  'thrift/tutorial_types.cpp'
]

# NOTE: This currently does not work if the compiler can not find all of
# Thrift's dependencies by default.
lib = cxx_library(
  inputs = cpp_compile(
    sources = map(buildlocal, sources),
  ) << thriftfiles,
  output = 'thrift-tutorial'
)
