1 # Boost Filesystem Library Build Jamfile
3 # (C) Copyright Beman Dawes 2002-2006
4 # (C) Copyright Andrey Semashev 2020, 2021
5 # Distributed under the Boost Software License, Version 1.0.
6 # See www.boost.org/LICENSE_1_0.txt
8 # See library home page at http://www.boost.org/libs/filesystem
16 explicit bcrypt advapi32 coredll ;
18 # The rule checks if a config macro is defined in the command line or build properties
19 rule has-config-flag ( flag : properties * )
21 if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
31 # The rule checks we're building for Windows and selects crypto API to be used
32 rule select-windows-crypto-api ( properties * )
36 if <target-os>windows in $(properties) || <target-os>cygwin in $(properties)
38 if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_BCRYPT : $(properties) ] &&
39 [ configure.builds ../config//has_bcrypt : $(properties) : "has BCrypt API" ]
41 result = <define>BOOST_FILESYSTEM_HAS_BCRYPT <library>bcrypt ;
45 result = <define>BOOST_FILESYSTEM_HAS_WINCRYPT ;
46 if [ configure.builds ../config//is_windows_ce : $(properties) : "is Windows CE" ]
48 result += <library>coredll ;
52 result += <library>advapi32 ;
57 #ECHO Result: $(result) ;
61 # The rule checks if statx syscall is supported
62 rule check-statx ( properties * )
66 if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_STATX : $(properties) ]
68 if [ configure.builds ../config//has_statx : $(properties) : "has statx" ]
70 result = <define>BOOST_FILESYSTEM_HAS_STATX ;
72 else if [ configure.builds ../config//has_statx_syscall : $(properties) : "has statx syscall" ]
74 result = <define>BOOST_FILESYSTEM_HAS_STATX_SYSCALL ;
78 #ECHO Result: $(result) ;
82 # The rule checks if std::atomic_ref is supported
83 rule check-cxx20-atomic-ref ( properties * )
87 if ! <threading>single in $(properties)
89 if ! [ configure.builds ../config//has_cxx20_atomic_ref : $(properties) : "has std::atomic_ref" ]
91 result = <define>BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF ;
92 result += <library>/boost/atomic//boost_atomic ;
97 result = <define>BOOST_FILESYSTEM_SINGLE_THREADED ;
100 #ECHO Result: $(result) ;
104 project boost/filesystem
106 <host-os>hpux,<toolset>gcc:<define>_INCLUDE_STDC__SOURCE_199901
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 ]
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 ]
115 [ check-target-builds ../config//has_fdopendir_nofollow "has fdopendir(O_NOFOLLOW)" : <define>BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW ]
116 <conditional>@check-statx
117 <conditional>@select-windows-crypto-api
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
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
136 codecvt_error_category
147 rule select-platform-specific-sources ( properties * )
151 if <target-os>windows in $(properties) || <target-os>cygwin in $(properties)
153 result += <source>windows_file_codecvt.cpp ;
161 : <define>BOOST_FILESYSTEM_SOURCE
162 <conditional>@select-platform-specific-sources
164 <link>shared:<define>BOOST_FILESYSTEM_DYN_LINK=1
165 <link>static:<define>BOOST_FILESYSTEM_STATIC_LINK=1
170 boost-install boost_filesystem ;