summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/units/test_headers/Jamfile.v2
blob: 8bcd8322ae6c876dd0f4eb2e131b6ab6251f08ce (plain)
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
# Jamfile.v2
#
# Copyright (c) 2007-2008
# Steven Watanabe
#
# 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 testing ;
import path ;
import regex ;
import print ;
import sequence ;
import feature ;

project boost/units/test_headers :
    requirements <include>$(BOOST_ROOT) <include>../../..
;

headers = [ path.glob-tree ../../../boost/units : *.hpp : detail ] ;

for local file in $(headers)
{
    compile test.cpp
      : # requirements
        <define>BOOST_UNITS_HEADER_NAME=$(file)
        <dependency>$(file)
      : # test name
        [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ;
}

feature.feature <generate-include-all-order> : forward reverse : incidental ;

rule generate-include-all ( target : sources * : properties * )
{
    print.output $(target) ;

    if <generate-include-all-order>reverse in $(properties)
    {
        sources = [ sequence.reverse $(sources) ] ;
    }

    for local file in $(sources)
    {
        print.text "#include <$(file:G=)>
" : overwrite ;
    }

}

make include_all1.cpp : $(headers) : @generate-include-all ;
make include_all2.cpp : $(headers) : @generate-include-all : <generate-include-all-order>reverse ;

# this ought to catch non-inlined functions and other duplicate definitions
link include_all1.cpp include_all2.cpp main.cpp : <include>. : include_all_headers ;