# file      : cxx/parser/polyroot/buildfile
# license   : not copyrighted - public domain

if ($build.meta_operation != 'dist')
{
  assert ($polymorphic) \
    "config.xsde_examples.polymorphic should be set to true for this example"

  assert ($stl) \
    "config.xsde_examples.stl should be set to true for this example"

  assert ($iostream) \
    "config.xsde_examples.iostream should be set to true for this example"

  assert ($exceptions) \
    "config.xsde_examples.exceptions should be set to true for this example"

  assert ($reuse_style != 'none') \
    "config.xsde_examples.reuse_style should not be set to 'none' for this example"

  assert (!$custom_allocator || $default_allocator) \
    "config.xsde_examples.default_allocator should be set to true for this example"
}

import libs = libxsde%lib{xsde}

./: exe{driver} doc{README} xml{batman person superman}

exe{driver}: {hxx     cxx}{* -supermen-pimpl-* -supermen-pskel} \
             {hxx ixx cxx}{                     supermen-pskel}

exe{driver}: {hxx cxx}{supermen-pimpl-tiein}: include = ($reuse_style == 'tiein')
exe{driver}: {hxx cxx}{supermen-pimpl-mixin}: include = ($reuse_style == 'mixin')

exe{driver}: $libs testscript

<{hxx ixx cxx}{supermen-pskel}>: xsd{supermen} $xsde
{{
  # For options contained in cxx_parser_options variable see build/root.build.
  #
  $xsde cxx-parser $cxx_parser_options \
        --generate-polymorphic	       \
        --output-dir $out_base         \
        $path($<[0])
}}

cxx.poptions =+ "-I$out_base" "-I$src_base"
