# file      : cxx/hybrid/custom/wildcard/buildfile
# license   : not copyrighted - public domain

if ($build.meta_operation != 'dist')
{
  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}

exe{driver}: {hxx     cxx}{* -email -email-pskel -email-pimpl  \
                                    -email-sskel -email-simpl} \
             {hxx ixx cxx}{   email  email-pskel  email-sskel} \
             {hxx     cxx}{          email-pimpl  email-simpl} \
             $libs

exe{driver}: xml{email}: test.input = true

<{hxx ixx cxx}{email email-pskel email-sskel}                    \
 {hxx     cxx}{      email-pimpl email-simpl}>: xsd{email} $xsde
{{
  # For options contained in cxx_hybrid_options variable see build/root.build.
  #
  $xsde cxx-hybrid $cxx_hybrid_options                                      \
        --generate-parser                                                   \
        --generate-serializer                                               \
        --generate-aggregate                                                \
        --custom-type envelope=v//envelope_base/envelope.hxx                \
        --custom-parser envelope=envelope_base_pimpl/envelope-pimpl.hxx     \
        --custom-serializer envelope=envelope_base_simpl/envelope-simpl.hxx \
        --hxx-epilogue '#include "body.hxx"'                                \
        --root-element-all                                                  \
        --output-dir $out_base                                              \
        $path($<[0])
}}

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

if ($reuse_style == 'mixin' && $cxx.class == 'gcc')
  cxx.coptions += -Wno-overloaded-virtual
