diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-01 16:10:48 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-01 16:41:08 +0300 |
commit | da9cbf29c403d27c2940f9b31199c4648f8ae4a1 (patch) | |
tree | 9732de6f48bdaead2becf32be41b1284e1e83e00 /libbuild2/version/buildfile | |
parent | 8e69e09b7ec68377758c63092f9b254e95a0d7be (diff) |
Move version build system module to separate library
Diffstat (limited to 'libbuild2/version/buildfile')
-rw-r--r-- | libbuild2/version/buildfile | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/libbuild2/version/buildfile b/libbuild2/version/buildfile new file mode 100644 index 0000000..e9d4905 --- /dev/null +++ b/libbuild2/version/buildfile @@ -0,0 +1,66 @@ +# file : libbuild2/version/buildfile +# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +import int_libs = libbutl%lib{butl} + +include ../ +int_libs += ../lib{build2} + +include ../in/ +int_libs += ../in/lib{build2-in} + +./: lib{build2-version}: libul{build2-version}: \ + {hxx ixx txx cxx}{** -**.test...} \ + $int_libs + +# 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}: libul{build2-version}: bin.whole = false +} + +# Build options. +# +obja{*}: cxx.poptions += -DLIBBUILD2_VERSION_STATIC_BUILD +objs{*}: cxx.poptions += -DLIBBUILD2_VERSION_SHARED_BUILD + +# Export options. +# +lib{build2-version}: +{ + cxx.export.poptions = "-I$out_root" "-I$src_root" + cxx.export.libs = $int_libs +} + +liba{build2-version}: cxx.export.poptions += -DLIBBUILD2_VERSION_STATIC +libs{build2-version}: cxx.export.poptions += -DLIBBUILD2_VERSION_SHARED + +# For pre-releases use the complete version to make sure they cannot be used +# in place of another pre-release or the final version. See the version module +# for details on the version.* variable values. +# +if $version.pre_release + lib{build2-version}: bin.lib.version = @"-$version.project_id" +else + lib{build2-version}: bin.lib.version = @"-$version.major.$version.minor" + +# Install into the libbuild2/version/ subdirectory of, say, /usr/include/ +# recreating subdirectories. +# +{hxx ixx txx}{*}: +{ + install = include/libbuild2/version/ + install.subdirs = true +} |