diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-08 14:51:57 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-27 11:38:53 +0300 |
commit | 720c5a33b6a49cf328fdd7611f49153cf8f60247 (patch) | |
tree | 9725f3d1f42ec90fde84520f49647edea013ce5e /cli/cli/buildfile | |
parent | 3183f3bb927a90783ae0aeaf190a0919377aabe4 (diff) |
Separate tests and examples into individual packages
Also make cli module to be explicitly enabled via the config.cli configuration
variable.
Diffstat (limited to 'cli/cli/buildfile')
-rw-r--r-- | cli/cli/buildfile | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/cli/cli/buildfile b/cli/cli/buildfile new file mode 100644 index 0000000..ff562c2 --- /dev/null +++ b/cli/cli/buildfile @@ -0,0 +1,75 @@ +# file : cli/buildfile +# license : MIT; see accompanying LICENSE file + +import libs = libcutl%lib{cutl} + +./: exe{cli}: cxx{cli} libue{cli} + +# Target metadata, see also --build2-metadata in cli.cxx. +# +exe{cli}: +{ + cli.version = $version.project_id + cli.checksum = $version +} + +libue{cli}: {hxx ixx txx cxx}{** -cli -version -options -**.test...} \ + {hxx}{version} {hxx ixx cxx}{options} \ + $libs + +hxx{version}: in{version} $src_root/manifest + +# Unit tests. +# +exe{*.test}: +{ + test = true + install = false +} + +for t: cxx{**.test...} +{ + d = $directory($t) + n = $name($t)... + + ./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n} + $d/exe{$n}: libue{cli}: bin.whole = false +} + +# Build options. +# +# Pass the copyright notice extracted from the LICENSE file. +# +copyright = $process.run_regex(cat $src_root/LICENSE, \ + 'Copyright \(c\) (.+)\.', \ + '\1') + +obj{cli}: cxx.poptions += -DCLI_COPYRIGHT=\"$copyright\" + +# Generated options parsing code. +# +# @@ This will eventually be replaced with an ah hoc recipe. +# +if ($config.cli != [null] && $config.cli != false) +{ + cli.cxx{options}: cli{options} + + cli.options += --include-with-brackets --include-prefix cli \ +--guard-prefix CLI --generate-file-scanner --generate-specifier \ +--generate-modifier --reserved-name stdout + + cli.cxx{*}: + { + # 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). + # + dist = true + clean = ($src_root != $out_root) + + # We keep the generated code in the repository so copy it back to src + # in case of a forwarded configuration. + # + backlink = overwrite + } +} |