summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/contract/build/boost_contract_no.jam-gen.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/contract/build/boost_contract_no.jam-gen.py
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/contract/build/boost_contract_no.jam-gen.py')
-rw-r--r--src/boost/libs/contract/build/boost_contract_no.jam-gen.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/boost/libs/contract/build/boost_contract_no.jam-gen.py b/src/boost/libs/contract/build/boost_contract_no.jam-gen.py
new file mode 100644
index 00000000..2c574273
--- /dev/null
+++ b/src/boost/libs/contract/build/boost_contract_no.jam-gen.py
@@ -0,0 +1,47 @@
+
+print '''
+# Generated file `python boost_contract_no.jam-gen.py > boost_contract_no.jam`.
+
+# Copyright (C) 2008-2018 Lorenzo Caminiti
+# Distributed under the Boost Software License, Version 1.0 (see accompanying
+# file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
+# See: https://lcaminiti.github.io/boost-contract
+'''
+
+import collections
+import itertools
+
+defs = collections.OrderedDict([
+ # Short keys (1-2 chars) as MSVC gives linker errors on long file names.
+ ('y', 'BOOST_CONTRACT_NO_ENTRY_INVARIANTS'),
+ ('r', 'BOOST_CONTRACT_NO_PRECONDITIONS'),
+ ('x', 'BOOST_CONTRACT_NO_EXIT_INVARIANTS'),
+ ('s', 'BOOST_CONTRACT_NO_POSTCONDITIONS'),
+ ('e', 'BOOST_CONTRACT_NO_EXCEPTS'),
+ ('k', 'BOOST_CONTRACT_NO_CHECKS')
+ # Add more macros here.
+])
+separator = '' # Might want to set to '_' if keys longer than 1 char.
+
+print 'module boost_contract_no {\n'
+s = ''
+exit
+for r in range(len(defs.keys())):
+ for comb in itertools.combinations(defs.keys(), r + 1):
+ c = ''
+ d = ''
+ sep = ''
+ for cond in comb:
+ c += sep + cond
+ sep = separator
+ d += " <define>" + defs[cond]
+ s += ' ' + c
+ print 'rule defs_{0} {{ return {1} ; }}\n'.format(c, d[1:])
+
+print '''rule combinations {{ return {0} ; }}
+
+}} # module
+
+# All combinations: {1}
+'''.format(s[1:], s.replace(" ", ",")[1:])
+