From 5e527213a2430bb3018e5eebd909aef294edf9b5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- xsd/xsd/buildfile | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 xsd/xsd/buildfile (limited to 'xsd/xsd/buildfile') diff --git a/xsd/xsd/buildfile b/xsd/xsd/buildfile new file mode 100644 index 0000000..49fbf2c --- /dev/null +++ b/xsd/xsd/buildfile @@ -0,0 +1,68 @@ +# file : xsd/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +import libs = libxsd-frontend%lib{xsd-frontend} +import libs += libcutl%lib{cutl} +import libs += libxerces-c%lib{xerces-c} + +options_topics = options cxx/options cxx/parser/options cxx/tree/options + +./: exe{xsd}: {hxx ixx txx cxx}{** -{$options_topics} -version} \ + {hxx ixx cxx}{$options_topics} \ + {hxx}{version} \ + $libs + +# Target metadata, see also --build2-metadata in xsd.cxx. +# +exe{xsd}: +{ + export.metadata = 1 xsd + xsd.name = [string] xsd + xsd.version = $version + xsd.checksum = $version +} + +hxx{version}: in{version} $src_root/manifest + +# Build options. +# +# Pass the copyright notice extracted from the LICENSE file. +# +obj{xsd cxx/parser/generator cxx/tree/generator}: \ + cxx.poptions += -DXSD_COPYRIGHT=\"$copyright\" + +# Generated options parser. +# +if $cli.configured +{ + cli.cxx{options}: cli{options} + cxx/cli.cxx{options}: cxx/cli{options} + cxx/parser/cli.cxx{options}: cxx/parser/cli{options} + cxx/tree/cli.cxx{options}: cxx/tree/cli{options} + + cli.options += --std c++11 -I $src_root --generate-specifier \ +--ostream-type ::std::wostream --exclude-base --suppress-undocumented \ +--generate-file-scanner --include-with-brackets --option-length 28 \ +--cxx-prologue '#include ' + + cli.cxx{options}: cli.options += --include-prefix xsd --guard-prefix XSD + + cxx/cli.cxx{options}: cli.options += --include-prefix xsd/cxx \ + --guard-prefix XSD_CXX + + cxx/parser/cli.cxx{options}: cli.options += --include-prefix xsd/cxx/parser \ + --guard-prefix XSD_CXX_PARSER + + cxx/tree/cli.cxx{options}: cli.options += --include-prefix xsd/cxx/tree \ + --guard-prefix XSD_CXX_TREE + + # Include the generated cli files into the distribution and don't remove + # them when cleaning in src (so that clean results in a state identical to + # distributed). + # + cli.cxx{*}: + { + dist = true + clean = ($src_root != $out_root) + } +} -- cgit v1.1