# Boost Filesystem Library Build Jamfile # (C) Copyright Beman Dawes 2002-2006 # (C) Copyright Andrey Semashev 2020, 2021 # Distributed under the Boost Software License, Version 1.0. # See www.boost.org/LICENSE_1_0.txt # See library home page at http://www.boost.org/libs/filesystem import project ; import configure ; lib bcrypt ; lib advapi32 ; lib coredll ; explicit bcrypt advapi32 coredll ; # The rule checks if a config macro is defined in the command line or build properties rule has-config-flag ( flag : properties * ) { if ( "$(flag)" in $(properties) || "$(flag)=1" in $(properties) ) { return 1 ; } else { return ; } } # The rule checks we're building for Windows and selects crypto API to be used rule select-windows-crypto-api ( properties * ) { local result ; if windows in $(properties) || cygwin in $(properties) { if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_BCRYPT : $(properties) ] && [ configure.builds ../config//has_bcrypt : $(properties) : "has BCrypt API" ] { result = BOOST_FILESYSTEM_HAS_BCRYPT bcrypt ; } else { result = BOOST_FILESYSTEM_HAS_WINCRYPT ; if [ configure.builds ../config//is_windows_ce : $(properties) : "is Windows CE" ] { result += coredll ; } else { result += advapi32 ; } } } #ECHO Result: $(result) ; return $(result) ; } # The rule checks if statx syscall is supported rule check-statx ( properties * ) { local result ; if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_STATX : $(properties) ] { if [ configure.builds ../config//has_statx : $(properties) : "has statx" ] { result = BOOST_FILESYSTEM_HAS_STATX ; } else if [ configure.builds ../config//has_statx_syscall : $(properties) : "has statx syscall" ] { result = BOOST_FILESYSTEM_HAS_STATX_SYSCALL ; } } #ECHO Result: $(result) ; return $(result) ; } # The rule checks if std::atomic_ref is supported rule check-cxx20-atomic-ref ( properties * ) { local result ; if ! single in $(properties) { if ! [ configure.builds ../config//has_cxx20_atomic_ref : $(properties) : "has std::atomic_ref" ] { result = BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF ; result += /boost/atomic//boost_atomic ; } } else { result = BOOST_FILESYSTEM_SINGLE_THREADED ; } #ECHO Result: $(result) ; return $(result) ; } project boost/filesystem : requirements hpux,gcc:_INCLUDE_STDC__SOURCE_199901 [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : BOOST_FILESYSTEM_HAS_INIT_PRIORITY ] [ check-target-builds ../config//has_stat_st_mtim "has stat::st_blksize" : BOOST_FILESYSTEM_HAS_STAT_ST_BLKSIZE ] [ check-target-builds ../config//has_stat_st_mtim "has stat::st_mtim" : BOOST_FILESYSTEM_HAS_STAT_ST_MTIM ] [ check-target-builds ../config//has_stat_st_mtimensec "has stat::st_mtimensec" : BOOST_FILESYSTEM_HAS_STAT_ST_MTIMENSEC ] [ check-target-builds ../config//has_stat_st_mtimespec "has stat::st_mtimespec" : BOOST_FILESYSTEM_HAS_STAT_ST_MTIMESPEC ] [ check-target-builds ../config//has_stat_st_birthtim "has stat::st_birthtim" : BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIM ] [ check-target-builds ../config//has_stat_st_birthtimensec "has stat::st_birthtimensec" : BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMENSEC ] [ check-target-builds ../config//has_stat_st_birthtimespec "has stat::st_birthtimespec" : BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMESPEC ] [ check-target-builds ../config//has_fdopendir_nofollow "has fdopendir(O_NOFOLLOW)" : BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW ] @check-statx @select-windows-crypto-api @check-cxx20-atomic-ref windows:_SCL_SECURE_NO_WARNINGS windows:_SCL_SECURE_NO_DEPRECATE windows:_CRT_SECURE_NO_WARNINGS windows:_CRT_SECURE_NO_DEPRECATE windows:BOOST_USE_WINDOWS_H windows:WIN32_LEAN_AND_MEAN windows:NOMINMAX cygwin:BOOST_USE_WINDOWS_H cygwin:WIN32_LEAN_AND_MEAN cygwin:NOMINMAX : source-location ../src : usage-requirements # pass these requirement to dependents (i.e. users) shared:BOOST_FILESYSTEM_DYN_LINK=1 static:BOOST_FILESYSTEM_STATIC_LINK=1 ; SOURCES = codecvt_error_category exception directory operations path path_traits portability unique_path utf8_codecvt_facet ; rule select-platform-specific-sources ( properties * ) { local result ; if windows in $(properties) || cygwin in $(properties) { result += windows_file_codecvt.cpp ; } return $(result) ; } lib boost_filesystem : $(SOURCES).cpp : BOOST_FILESYSTEM_SOURCE @select-platform-specific-sources ../src shared:BOOST_FILESYSTEM_DYN_LINK=1 static:BOOST_FILESYSTEM_STATIC_LINK=1 : : ; boost-install boost_filesystem ;