]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | # Boost Filesystem Library Build Jamfile |
2 | ||
3 | # (C) Copyright Beman Dawes 2002-2006 | |
1e59de90 | 4 | # (C) Copyright Andrey Semashev 2020, 2021 |
7c673cae FG |
5 | # Distributed under the Boost Software License, Version 1.0. |
6 | # See www.boost.org/LICENSE_1_0.txt | |
7 | ||
8 | # See library home page at http://www.boost.org/libs/filesystem | |
9 | ||
20effc67 TL |
10 | import project ; |
11 | import configure ; | |
12 | ||
13 | lib bcrypt ; | |
14 | lib advapi32 ; | |
15 | lib coredll ; | |
16 | explicit bcrypt advapi32 coredll ; | |
17 | ||
1e59de90 TL |
18 | # The rule checks if a config macro is defined in the command line or build properties |
19 | rule has-config-flag ( flag : properties * ) | |
20 | { | |
21 | if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) ) | |
22 | { | |
23 | return 1 ; | |
24 | } | |
25 | else | |
26 | { | |
27 | return ; | |
28 | } | |
29 | } | |
30 | ||
20effc67 TL |
31 | # The rule checks we're building for Windows and selects crypto API to be used |
32 | rule select-windows-crypto-api ( properties * ) | |
33 | { | |
34 | local result ; | |
35 | ||
36 | if <target-os>windows in $(properties) || <target-os>cygwin in $(properties) | |
37 | { | |
1e59de90 TL |
38 | if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_BCRYPT : $(properties) ] && |
39 | [ configure.builds ../config//has_bcrypt : $(properties) : "has BCrypt API" ] | |
20effc67 TL |
40 | { |
41 | result = <define>BOOST_FILESYSTEM_HAS_BCRYPT <library>bcrypt ; | |
42 | } | |
43 | else | |
44 | { | |
45 | result = <define>BOOST_FILESYSTEM_HAS_WINCRYPT ; | |
46 | if [ configure.builds ../config//is_windows_ce : $(properties) : "is Windows CE" ] | |
47 | { | |
48 | result += <library>coredll ; | |
49 | } | |
50 | else | |
51 | { | |
52 | result += <library>advapi32 ; | |
53 | } | |
54 | } | |
55 | } | |
56 | ||
57 | #ECHO Result: $(result) ; | |
58 | return $(result) ; | |
59 | } | |
60 | ||
1e59de90 TL |
61 | # The rule checks if statx syscall is supported |
62 | rule check-statx ( properties * ) | |
63 | { | |
64 | local result ; | |
65 | ||
66 | if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_STATX : $(properties) ] | |
67 | { | |
68 | if [ configure.builds ../config//has_statx : $(properties) : "has statx" ] | |
69 | { | |
70 | result = <define>BOOST_FILESYSTEM_HAS_STATX ; | |
71 | } | |
72 | else if [ configure.builds ../config//has_statx_syscall : $(properties) : "has statx syscall" ] | |
73 | { | |
74 | result = <define>BOOST_FILESYSTEM_HAS_STATX_SYSCALL ; | |
75 | } | |
76 | } | |
77 | ||
78 | #ECHO Result: $(result) ; | |
79 | return $(result) ; | |
80 | } | |
81 | ||
82 | # The rule checks if std::atomic_ref is supported | |
83 | rule check-cxx20-atomic-ref ( properties * ) | |
84 | { | |
85 | local result ; | |
86 | ||
87 | if ! <threading>single in $(properties) | |
88 | { | |
89 | if ! [ configure.builds ../config//has_cxx20_atomic_ref : $(properties) : "has std::atomic_ref" ] | |
90 | { | |
91 | result = <define>BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF ; | |
92 | result += <library>/boost/atomic//boost_atomic ; | |
93 | } | |
94 | } | |
95 | else | |
96 | { | |
97 | result = <define>BOOST_FILESYSTEM_SINGLE_THREADED ; | |
98 | } | |
99 | ||
100 | #ECHO Result: $(result) ; | |
101 | return $(result) ; | |
102 | } | |
103 | ||
7c673cae | 104 | project boost/filesystem |
20effc67 TL |
105 | : requirements |
106 | <host-os>hpux,<toolset>gcc:<define>_INCLUDE_STDC__SOURCE_199901 | |
1e59de90 TL |
107 | [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : <define>BOOST_FILESYSTEM_HAS_INIT_PRIORITY ] |
108 | [ check-target-builds ../config//has_stat_st_mtim "has stat::st_blksize" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BLKSIZE ] | |
20effc67 TL |
109 | [ check-target-builds ../config//has_stat_st_mtim "has stat::st_mtim" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_MTIM ] |
110 | [ check-target-builds ../config//has_stat_st_mtimensec "has stat::st_mtimensec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_MTIMENSEC ] | |
111 | [ check-target-builds ../config//has_stat_st_mtimespec "has stat::st_mtimespec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_MTIMESPEC ] | |
112 | [ check-target-builds ../config//has_stat_st_birthtim "has stat::st_birthtim" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIM ] | |
113 | [ check-target-builds ../config//has_stat_st_birthtimensec "has stat::st_birthtimensec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMENSEC ] | |
114 | [ check-target-builds ../config//has_stat_st_birthtimespec "has stat::st_birthtimespec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMESPEC ] | |
1e59de90 TL |
115 | [ check-target-builds ../config//has_fdopendir_nofollow "has fdopendir(O_NOFOLLOW)" : <define>BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW ] |
116 | <conditional>@check-statx | |
20effc67 | 117 | <conditional>@select-windows-crypto-api |
1e59de90 TL |
118 | <conditional>@check-cxx20-atomic-ref |
119 | <target-os>windows:<define>_SCL_SECURE_NO_WARNINGS | |
120 | <target-os>windows:<define>_SCL_SECURE_NO_DEPRECATE | |
121 | <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS | |
122 | <target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE | |
123 | <target-os>windows:<define>BOOST_USE_WINDOWS_H | |
124 | <target-os>windows:<define>WIN32_LEAN_AND_MEAN | |
125 | <target-os>windows:<define>NOMINMAX | |
126 | <target-os>cygwin:<define>BOOST_USE_WINDOWS_H | |
127 | <target-os>cygwin:<define>WIN32_LEAN_AND_MEAN | |
128 | <target-os>cygwin:<define>NOMINMAX | |
7c673cae FG |
129 | : source-location ../src |
130 | : usage-requirements # pass these requirement to dependents (i.e. users) | |
131 | <link>shared:<define>BOOST_FILESYSTEM_DYN_LINK=1 | |
132 | <link>static:<define>BOOST_FILESYSTEM_STATIC_LINK=1 | |
133 | ; | |
134 | ||
135 | SOURCES = | |
136 | codecvt_error_category | |
92f5a8d4 TL |
137 | exception |
138 | directory | |
139 | operations | |
140 | path | |
141 | path_traits | |
142 | portability | |
143 | unique_path | |
144 | utf8_codecvt_facet | |
92f5a8d4 | 145 | ; |
7c673cae | 146 | |
1e59de90 TL |
147 | rule select-platform-specific-sources ( properties * ) |
148 | { | |
149 | local result ; | |
150 | ||
151 | if <target-os>windows in $(properties) || <target-os>cygwin in $(properties) | |
152 | { | |
153 | result += <source>windows_file_codecvt.cpp ; | |
154 | } | |
155 | ||
156 | return $(result) ; | |
157 | } | |
158 | ||
7c673cae | 159 | lib boost_filesystem |
92f5a8d4 TL |
160 | : $(SOURCES).cpp |
161 | : <define>BOOST_FILESYSTEM_SOURCE | |
1e59de90 | 162 | <conditional>@select-platform-specific-sources |
20effc67 | 163 | <include>../src |
92f5a8d4 | 164 | <link>shared:<define>BOOST_FILESYSTEM_DYN_LINK=1 |
7c673cae FG |
165 | <link>static:<define>BOOST_FILESYSTEM_STATIC_LINK=1 |
166 | : | |
92f5a8d4 | 167 | : |
7c673cae FG |
168 | ; |
169 | ||
170 | boost-install boost_filesystem ; |