Skip to content

Commit 8dc455e

Browse files
committed
Made has-config-flag more flexible.
The has-config-flag rule now matches any value of the checked macro and is able to test multiple macros in one call.
1 parent f7ed6b5 commit 8dc455e

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

build/Jamfile.v2

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Boost Filesystem Library Build Jamfile
22

33
# (C) Copyright Beman Dawes 2002-2006
4-
# (C) Copyright Andrey Semashev 2020-2024
4+
# (C) Copyright Andrey Semashev 2020-2025
55
# Distributed under the Boost Software License, Version 1.0.
66
# See www.boost.org/LICENSE_1_0.txt
77

@@ -17,17 +17,21 @@ lib advapi32 ;
1717
lib coredll ;
1818
explicit bcrypt advapi32 coredll ;
1919

20-
# The rule checks if a config macro is defined in the command line or build properties
21-
rule has-config-flag ( flag : properties * )
20+
# The rule checks if there is one of the defines listed in `flags` in `properties`. The value of the define is not considered.
21+
rule has-config-flag ( flags + : properties * )
2222
{
23-
if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
23+
for local property in $(properties)
2424
{
25-
return 1 ;
26-
}
27-
else
28-
{
29-
return ;
25+
for local flag in $(flags)
26+
{
27+
if [ MATCH "^(<define>$(flag))(=.*)?$" : $(property) ]
28+
{
29+
return 1 ;
30+
}
31+
}
3032
}
33+
34+
return ;
3135
}
3236

3337
# The rule checks we're building for Windows and selects crypto API to be used

0 commit comments

Comments
 (0)