-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJamroot
122 lines (105 loc) · 3.01 KB
/
Jamroot
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
# Copyright NTU CSIE CMLAB 2005 - 2012
# 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)
# Usage:
#
# bjam [options] [properties] [install|stage]
#
# Builds cmlib.
#
# Targets and Related Options:
#
# --help This message.
#
# --with-system-libs link with system libraries.
#
# --system-prefix prefix of system libraries, default is /usr
# useful only when --with-system-libs
#
import common ;
import modules ;
import property-set ;
import os ;
path-constant TOP : . ;
default-build =
<variant>debug <variant>release
<link>shared <link>static
<address-model>32
<threading>multi
;
project cmlib
: requirements <include>.
<conditional>@handle-static-runtime
<tag>@handle-tag
<toolset>msvc,<link>shared:<define>CMLIB_BUILD_DLL
: usage-requirements <include>.
<toolset>msvc,<link>shared:<define>CMLIB_LINK_DLL
: build-dir bin
: default-build $(default-build)
;
if --with-system-libs in [ modules.peek : ARGV ]
{
use-project /contrib : contrib/sys ;
other-libs = ;
} else {
use-project /contrib : contrib/local ;
other-libs = /contrib ;
}
cmlib-libs = image video dip ;
all-libs = $(other-libs) /cmlib/$(cmlib-libs) ;
# ECHO lib/$(cmlib-libs)/test ;
# Install just library.
install dist
: $(all-libs)
: <install-type>LIB
<conditional>@handle-location
;
# build all libs
for local lib in $(cmlib-libs)
{
use-project /cmlib/$(lib) : lib/$(lib) ;
}
alias test : lib/$(cmlib-libs)/test ;
explicit test ;
rule handle-static-runtime ( properties * )
{
# This property combination is dangerous.
# Ideally, we'd add constraint to default build,
# so that user can build with property combination
# by hand. But we don't have any 'constraint' mechanism
# for default-build, so disable such builds in requirements.
# For CW, static runtime is needed so that
# std::locale works.
if <link>shared in $(properties)
&& <runtime-link>static in $(properties)
&& ! ( <toolset>cw in $(properties) )
{
return <build>no ;
}
}
rule handle-tag ( name : type ? : property-set )
{
if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
{
local result = [ common.format-name
<base> <runtime>
: $(name) : $(type) : $(property-set) ] ;
return $(result) ;
}
}
rule handle-location ( properties * )
{
local prefix = [ MATCH "^--prefix=(.*)" : [ modules.peek : ARGV ] ] ;
prefix ?= dist ;
local pset = [ property-set.create $(properties) ] ;
local toolset = [ $(pset).get <toolset> ] ;
local version = [ $(pset).get <toolset-$(toolset):version> ] ;
local variant = [ $(pset).get <variant> ] ;
local link = [ $(pset).get <link> ] ;
local uname = [ os.name ] ;
local bit = [ $(pset).get <address-model> ] ;
# local path = <location>$(toolset)-$(version)/$(variant)/$(link) ;
local path = <location>$(prefix)/$(toolset)-$(version)-$(uname:L)-$(bit)bit/$(variant)/$(link) ;
return $(path) ;
}