File: build.jam

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 (89 lines) | stat: -rw-r--r-- 2,792 bytes parent folder | download | duplicates (3)
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
# Copyright Rene Rivera 2011-2023
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

import predef : require check : predef-require predef-check ;
import common ;
import path ;
import regex ;

project
    :   requirements
        # Add explicit dependency since we don't have header scanner for
        # .m and .mm files.
        <dependency>../include/boost/predef.h
    ;

using testing ;

test-suite predef-info :
    [ run info_as_cpp.cpp : : : <test-info>always_show_run_output ]
    [ run info_as_c.c : : : <test-info>always_show_run_output ]
    [ run info_as_objcpp.mm : : : <test-info>always_show_run_output <conditional>@objc ]
    [ run info_as_objc.m : : : <test-info>always_show_run_output <conditional>@objc ]
    ;

rule objc ( props * )
{
    if ! ( <target-os>darwin in $(props) )
    {
        return <build>no ;
    }
}

test-suite predef :
    [ run version.cpp ]
    [ run make.cpp ]
    [ compile macos_endian.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ]
    [ compile macos_vs_bsd.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ]
    [ run check_value.cpp : : : <test-info>always_show_run_output
        [ predef-check "BOOST_COMP_CLANG > 0.0.0" "BOOST_OS_LINUX == 0" : : <cxxflags>-DCHECK_VALUE=true ] ]
    [ run workaround.cpp ]
    [ compile workaround_strict_config.cpp ]
    [ run tested_at.cpp ]
    [ compile-fail tested_at_outdated.cpp : <test-info>always_show_run_output ]
    [ compile platform_windows.cpp ]
    ;

local single_header_cpp ;
for local h in [ glob-tree-ex ../include/boost/predef : *.h ]
{
    local header_include = [ path.relative $(h) ../include ] ;
    local header_cpp = [ regex.replace $(header_include:S=.cpp) "/" "_" ] ;
    .HEADER($(header_cpp:B:S=)) = $(header_include) ;
    make $(header_cpp) : : @gen_single_header_cpp ;
    explicit $(header_cpp) ;
    compile $(header_cpp) : <warnings-as-errors>on <warnings>all : $(header_cpp:B:S=) ;
    explicit $(header_cpp:B:S=) ;
    single_header_cpp += $(header_cpp:B:S=) ;
}

test-suite predef-headers : $(single_header_cpp) ;

.file_touch_cmd = [ common.file-touch-command ] ;

rule gen_single_header_cpp ( target * : source * : properties * )
{
    HEADER on $(target) = $(.HEADER($(target[1]:B))) ;
}
actions gen_single_header_cpp
{
    $(.file_touch_cmd) @($(<):<=":>=":O=F:E=#include <$(HEADER)>)
}

# Minimal testing done for predef for CI. Since
# we don't have many we can just do all of them.
alias minimal : predef predef-info ;

# Full testing target for regular regression tests.
alias full : predef predef-info ;

# Extra's target.
alias extra : predef-headers ;

alias all : predef predef-info predef-headers ;

explicit minimal ;
explicit extra ;
explicit all ;