1 From 78fd284a42caabe8815cb0870b46e5567872e75b Mon Sep 17 00:00:00 2001
2 From: Dmitry <grisumbras@gmail.com>
3 Date: Sat, 11 Dec 2021 16:58:23 +0300
4 Subject: [PATCH] Don't skip install targets if there's <build>no in ureqs
5 (#113)
6
7 ---
8 src/tools/stage.jam | 4 ++++
9 test/install_build_no.py | 26 ++++++++++++++++++++++++++
10 test/test_all.py | 1 +
11 3 files changed, 31 insertions(+)
12 create mode 100755 test/install_build_no.py
13
14 diff --git a/src/tools/stage.jam b/src/tools/stage.jam
15 index c5f02e3ba4..325129dc81 100644
16 --- a/src/tools/stage.jam
17 +++ b/src/tools/stage.jam
18 @@ -478,6 +478,10 @@ class install-target-class : basic-target
19 return [ sequence.unique $(result2) ] ;
20 }
21
22 + rule skip-from-usage-requirements ( )
23 + {
24 + }
25 +
26 # Returns true iff 'type' is subtype of some element of 'types-to-include'.
27 #
28 local rule include-type ( type : types-to-include * )
29 diff --git a/test/install_build_no.py b/test/install_build_no.py
30 new file mode 100755
31 index 0000000000..0ccf3c5cc6
32 --- /dev/null
33 +++ b/test/install_build_no.py
34 @@ -0,0 +1,26 @@
35 +#!/usr/bin/python
36 +
37 +# Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com)
38 +# Distributed under the Boost Software License, Version 1.0.
39 +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
40 +
41 +# Check that <build>no in usage-requirements of dependencies does not affect
42 +# install rule, i.e. a skipped installed target does not affect insallation of
43 +# other targets.
44 +
45 +import BoostBuild
46 +
47 +t = BoostBuild.Tester()
48 +
49 +t.write("a.cpp", "int main() {}\n")
50 +
51 +t.write("jamroot.jam", """
52 +make x : : maker : <build>no ;
53 +exe a : a.cpp ;
54 +install install : x a ;
55 +""")
56 +
57 +t.run_build_system()
58 +t.expect_addition("install/a.exe")
59 +
60 +t.cleanup()
61 diff --git a/test/test_all.py b/test/test_all.py
62 index b7ef5ad701..9ed729d017 100644
63 --- a/test/test_all.py
64 +++ b/test/test_all.py
65 @@ -250,6 +250,7 @@ def reorder_tests(tests, first_test):
66 "inherit_toolset",
67 "inherited_dependency",
68 "inline",
69 + "install_build_no",
70 "libjpeg",
71 "liblzma",
72 "libpng",
|