File: Jamfile.v2

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (225 lines) | stat: -rw-r--r-- 7,853 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Boost Filesystem Library Build Jamfile

# (C) Copyright Beman Dawes 2002-2006
# (C) Copyright Andrey Semashev 2020-2024
# 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 ;
import-search /boost/config/checks ;
import config : requires ;

searched-lib bcrypt ;
searched-lib advapi32 ;
searched-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 ( "<define>$(flag)" in $(properties) || "<define>$(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 <target-os>windows in $(properties) || <target-os>cygwin in $(properties)
    {
        if ! [ has-config-flag BOOST_FILESYSTEM_DISABLE_BCRYPT : $(properties) ] &&
            [ configure.builds ../config//has_bcrypt : $(properties) : "has BCrypt API" ]
        {
            result = <define>BOOST_FILESYSTEM_HAS_BCRYPT <library>bcrypt ;
        }
        else
        {
            result = <define>BOOST_FILESYSTEM_HAS_WINCRYPT ;
            if [ configure.builds ../config//is_windows_ce : $(properties) : "is Windows CE" ]
            {
                result += <library>coredll ;
            }
            else
            {
                result += <library>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 = <define>BOOST_FILESYSTEM_HAS_STATX ;
        }
        else if [ configure.builds ../config//has_statx_syscall : $(properties) : "has statx syscall" ]
        {
            result = <define>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 ! <threading>single in $(properties)
    {
        if ! [ configure.builds ../config//has_cxx20_atomic_ref : $(properties) : "has std::atomic_ref" ]
        {
            result = <define>BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF ;
            result += <library>/boost/atomic//boost_atomic ;
        }
    }
    else
    {
        result = <define>BOOST_FILESYSTEM_SINGLE_THREADED ;
    }

    #ECHO Result: $(result) ;
    return $(result) ;
}

# The rule checks if the linker supports requiring no unresolved symbols
rule check-linkflag-no-undefined ( properties * )
{
    local result ;

    if <link>shared in $(properties)
    {
        if [ configure.builds ../config//has_linkflag_no_undefined : $(properties) : "has -Wl,--no-undefined" ]
        {
            result = <linkflags>"-Wl,--no-undefined" ;
        }
        else if [ configure.builds ../config//has_linkflag_undefined_error : $(properties) : "has -Wl,-undefined,error" ]
        {
            result = <linkflags>"-Wl,-undefined,error" ;
        }
    }

    #ECHO Result: $(result) ;
    return $(result) ;
}

local cxx_requirements = [ requires
    cxx11_rvalue_references
    cxx11_scoped_enums
    cxx11_noexcept
    cxx11_nullptr
    cxx11_defaulted_functions
    cxx11_defaulted_moves
    cxx11_deleted_functions
    cxx11_function_template_default_args
    cxx11_final
    cxx11_override
] ;

project
    : common-requirements <library>$(boost_dependencies)
    : requirements
      <library>/boost/core//boost_core
      <library>/boost/predef//boost_predef
      <library>/boost/scope//boost_scope
      <target-os>windows:<library>/boost/winapi//boost_winapi
      <host-os>hpux,<toolset>gcc:<define>_INCLUDE_STDC__SOURCE_199901
      [ check-target-builds ../config//has_attribute_init_priority "has init_priority attribute" : <define>BOOST_FILESYSTEM_HAS_INIT_PRIORITY ]
      [ check-target-builds ../config//has_stat_st_mtim "has stat::st_blksize" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BLKSIZE ]
      [ check-target-builds ../config//has_stat_st_mtim "has stat::st_mtim" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_MTIM ]
      [ check-target-builds ../config//has_stat_st_mtimensec "has stat::st_mtimensec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_MTIMENSEC ]
      [ check-target-builds ../config//has_stat_st_mtimespec "has stat::st_mtimespec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_MTIMESPEC ]
      [ check-target-builds ../config//has_stat_st_birthtim "has stat::st_birthtim" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIM ]
      [ check-target-builds ../config//has_stat_st_birthtimensec "has stat::st_birthtimensec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMENSEC ]
      [ check-target-builds ../config//has_stat_st_birthtimespec "has stat::st_birthtimespec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMESPEC ]
      [ check-target-builds ../config//has_fdopendir_nofollow "has fdopendir(O_NOFOLLOW)" : <define>BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW ]
      [ check-target-builds ../config//has_dirent_d_type "has dirent::d_type" : <define>BOOST_FILESYSTEM_HAS_DIRENT_D_TYPE ]
      [ check-target-builds ../config//has_posix_at_apis "has POSIX *at APIs" : <define>BOOST_FILESYSTEM_HAS_POSIX_AT_APIS ]
      [ check-target-builds ../config//has_fallocate "has fallocate" : <define>BOOST_FILESYSTEM_HAS_FALLOCATE ]
      <conditional>@check-statx
      <conditional>@select-windows-crypto-api
      <conditional>@check-cxx20-atomic-ref
      # Make sure no undefined references are left from the library
      <conditional>@check-linkflag-no-undefined
      <target-os>windows:<define>_SCL_SECURE_NO_WARNINGS
      <target-os>windows:<define>_SCL_SECURE_NO_DEPRECATE
      <target-os>windows:<define>_CRT_SECURE_NO_WARNINGS
      <target-os>windows:<define>_CRT_SECURE_NO_DEPRECATE
      <target-os>windows:<define>BOOST_USE_WINDOWS_H
      <target-os>windows:<define>_WIN32_WINNT=0x0A00
      <target-os>windows:<define>WIN32_LEAN_AND_MEAN
      <target-os>windows:<define>NOMINMAX
      <target-os>cygwin:<define>BOOST_USE_WINDOWS_H
      <target-os>cygwin:<define>_WIN32_WINNT=0x0A00
      <target-os>cygwin:<define>WIN32_LEAN_AND_MEAN
      <target-os>cygwin:<define>NOMINMAX

      # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
      # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
      <toolset>gcc-12:<cxxflags>"-Wno-restrict"

    : source-location ../src
    : usage-requirements # pass these requirement to dependents (i.e. users)
      <link>shared:<define>BOOST_FILESYSTEM_DYN_LINK=1
      <link>static:<define>BOOST_FILESYSTEM_STATIC_LINK=1
      <define>BOOST_FILESYSTEM_NO_LIB=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 <target-os>windows in $(properties) || <target-os>cygwin in $(properties)
    {
        result += <source>windows_file_codecvt.cpp ;
    }

    return $(result) ;
}

lib boost_filesystem
    : ## sources ##
      $(SOURCES).cpp
    : ## requirements ##
      <define>BOOST_FILESYSTEM_SOURCE
      <conditional>@select-platform-specific-sources
      <include>../src
      <link>shared:<define>BOOST_FILESYSTEM_DYN_LINK=1
      <link>static:<define>BOOST_FILESYSTEM_STATIC_LINK=1
      $(cxx_requirements)
    : usage-requirements
      $(cxx_requirements)
    ;