From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../tools/build/example/pkg-config/jamroot.jam | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 src/boost/tools/build/example/pkg-config/jamroot.jam (limited to 'src/boost/tools/build/example/pkg-config/jamroot.jam') diff --git a/src/boost/tools/build/example/pkg-config/jamroot.jam b/src/boost/tools/build/example/pkg-config/jamroot.jam new file mode 100644 index 000000000..190948174 --- /dev/null +++ b/src/boost/tools/build/example/pkg-config/jamroot.jam @@ -0,0 +1,104 @@ +#| +Copyright 2019 Dmitry Arkhipov +Distributed under the Boost Software License, Version 1.0. (See +accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +|# + + +using pkg-config : : : packages ; +using pkg-config : debug : : packages debug-packages ; + +import common ; +import pkg-config ; +import property-set ; +import testing ; +import version ; + + +project : requirements debug:debug ; + + +pkg-config.import debugged ; +pkg-config.import foobar : requirements >=0.3 ; +pkg-config.import mangled : requirements @mangle-name ; + +versioned = + [ pkg-config.import versioned + : usage-requirements @versioned-api + ] ; + +with-var = + [ pkg-config.import with-var + : usage-requirements @var-to-define + ] ; + + +# test if a package is found at all +run test1.cpp foobar ; + +# test if conditional requirement is applied +run test2.cpp mangled + : target-name test2-1 + : requirements single + : args SINGLE + ; + +run test2.cpp mangled + : target-name test2-2 + : requirements multi + : args MULTI + ; + +# test if pkg-config configuration is properly inferred from property set +run test3.cpp debugged + : target-name test3-1 + : requirements release + : args RELEASE + ; + +run test3.cpp debugged + : target-name test3-2 + : requirements debug + : args DEBUG + ; + +# test use of version method of pkg-config targets +run test4.cpp versioned ; + +# test use of variable method of pkg-config targets +run test5.cpp with-var ; + + +rule mangle-name ( props * ) { + import feature ; + local name = + [ common.format-name + + : mangled + : "" + : [ property-set.create $(props) ] + ] ; + return $(name) ; +} + + +rule versioned-api ( props * ) { + local ps = [ property-set.create $(props) ] ; + local version = [ $(versioned).version $(ps) ] ; + if [ version.version-less $(version) : 2 ] + { + return VERSIONED_API=1 ; + } + else + { + return VERSIONED_API=2 ; + } +} + + +rule var-to-define ( props * ) { + local ps = [ property-set.create $(props) ] ; + local qwerty = [ $(with-var).variable qwerty : $(ps) ] ; + return QWERTY=\\\"$(qwerty)\\\" ; +} -- cgit v1.2.3