summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/geometry/test/headers/Jamfile
blob: 4f245dd48219c010f9f36998d8ec146872722ae2 (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
57
58
59
60
61
# Boost.Geometry (aka GGL, Generic Geometry Library)
#
# Copyright (c) 2018 Mateusz Loskot <mateusz@loskot.net>
#
# Use, modification and distribution is subject to 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 os ;
import path ;
import regex ;

rule generate_self_contained_headers ( headers_subpath )
{
    # This rule is based on script copied from similar rule in Boost.GIL
    # On CI services, test the self-contained headers on-demand only to avoid build timeouts
    # CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
    # For example:
    # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
    #    alias self_contained_headers : [ generate_self_contained_headers ] ;
    # }

    local targets ;

    # NOTE: All '/' in test names are replaced with '-' because apparently
    #       test scripts have a problem with test names containing slashes.

    local top_headers_path = [ path.make $(BOOST_ROOT)/libs/geometry/include/boost/geometry ] ;

    for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp ]
    {
        local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
        local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ;
        local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
        targets += [
            compile $(BOOST_ROOT)/libs/geometry/test/headers/main.cpp
            : <define>"BOOST_GEOMETRY_TEST_HEADER=$(rel_file)" <dependency>$(file)
            : $(target_name)
        ] ;
    }

    return $(targets) ;
}

# TODO: Review sorting to get as close as possible from general to specific

# Core
alias core : [ generate_self_contained_headers core ] ;
alias util : [ generate_self_contained_headers util ] ;
alias policies : [ generate_self_contained_headers policies ] ;
alias geometries : [ generate_self_contained_headers geometries ] ;
alias concepts : [ generate_self_contained_headers concepts ] ;
alias arithmetic : [ generate_self_contained_headers arithmetic ] ;
alias formulas : [ generate_self_contained_headers formulas ] ;
alias iterators : [ generate_self_contained_headers iterators ] ;
alias strategies : [ generate_self_contained_headers strategies ] ;
alias srs : [ generate_self_contained_headers srs ] ;
alias algorithms : [ generate_self_contained_headers algorithms ] ;
alias views : [ generate_self_contained_headers views ] ;
# Even though index is a separate submodule test headers here
alias index : [ generate_self_contained_headers index ] ;