# file      : cxx/serializer/generated-impl/buildfile
# license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

# Note that this test only checks compilation of the generated empty
# implementation and test driver. It may not work well with some compilers
# that issue warnings (missing return statements), which we suppress.

if ($build.meta_operation != 'dist')
{
  assert ($reuse_style != 'none') \
    "config.xsde_tests.reuse_style should not be set to 'none' for this test"

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

import libs = libxsde%lib{xsde}

exe{driver}: {hxx ixx cxx}{test-sskel}   \
             {hxx     cxx}{test-simpl}   \
             {        cxx}{test-sdriver} \
             $libs

exe{driver}: test = false

<{hxx ixx cxx}{test-sskel}                     \
 {hxx     cxx}{test-simpl}                     \
 {        cxx}{test-sdriver}>: xsd{test} $xsde
{{
  $xsde cxx-serializer $cxx_serializer_options \
        --generate-empty-impl                  \
        --generate-test-driver                 \
        --force-overwrite                      \
        --output-dir $out_base                 \
        $path($<[0])
}}

cxx.poptions =+ "-I$out_base"

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

if ($cxx.class == 'gcc')
  obj{test-simpl}: cxx.coptions += -Wno-return-type -Wno-unused-parameter
elif ($cxx.class == 'msvc')
  obj{test-simpl}: cxx.coptions += /wd4716
