forked from proteanic/protean
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJamroot.jam
More file actions
264 lines (225 loc) · 7 KB
/
Copy pathJamroot.jam
File metadata and controls
264 lines (225 loc) · 7 KB
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# Quickstart: Run build.sh. You may need to install Cygwin first if
# using Windows (www.cygwin.com). This may take a long time, but you
# will be able to invoke bjam directly for subsequent builds. The
# command line to use will be shown just before build.sh terminates.
# Slower start:
#
# Install Boost. You will need iostreams with zlib support. You should
# specify --build-type=complete if using Windows
#
# Install Xerces (optional)
#
# Put bjam on your path. Under Linux/Cygwin this can be done e.g. by
# export PATH=${PATH}:/cygdrive/c/boost_1_41_0
#
# Set BOOST_BUILD_PATH, under Linux/Cygwin this can be done e.g. by
# export BOOST_BUILD_PATH c:/boost_1_41_0
#
# Copy user-config.jam.example to user-config.jam and edit the
# settings to match your system. You can also use environment
# variables if you prefer. The user-config file will take precedence
# if both methods are used. You can just set NO_XERCES to 1 if you are
# in a hurry as everything else then has a reasonable default.
#
# run bjam in the directory this file is in. It will compile everything,
# and then it will run the unit tests.
PROTEAN_VERSION = 1_04 ;
include user-config.jam ;
import os ;
import common ;
if ! [ os.environ BOOST_BUILD_PATH ]
{
EXIT Protean: BOOST_BUILD_PATH needs to be set to the toplevel directory of a Boost distribution, e.g. c:/boost_1_41_0 ;
}
BOOSTROOT = [ os.environ BOOST_BUILD_PATH ] ;
BOOST_INCLUDE ?= $(BOOSTROOT) ;
if ! $(BOOST_LIB)
{
BOOST_LIB += $(BOOSTROOT)/stage/lib ;
}
if ! $(BOOST_LIB)
{
EXIT Protean: BOOST_LIB must be set ;
}
NO_XERCES ?= [ os.environ NO_XERCES ] ;
XERCES_BINARY ?= [ os.environ XERCES_BINARY ] ;
XERCES_LIBPATH ?= [ os.environ XERCES_LIBPATH ] ;
XERCES_INCLUDE ?= [ os.environ XERCES_INCLUDE ] ;
if $(NO_XERCES)
{
if ! $(NO_XERCES) in 0 1
{
ECHO "warning: NO_XERCES should be either '0' or '1'" ;
}
}
if $(DEBUG_PATHS)
{
ECHO env.BOOST_BUILD_PATH= [ os.environ BOOST_BUILD_PATH ] ;
ECHO BOOST_LIB=$(BOOST_LIB) ;
ECHO XERCES_INCLUDE=$(XERCES_INCLUDE) ;
ECHO XERCES_LIBPATH=$(XERCES_LIBPATH) ;
ECHO XERCES_BINARY=$(XERCES_BINARY) ;
ECHO NO_XERCES=$(NO_XERCES) ;
}
using testing ;
import boost ;
boost.use-project ;
project : requirements
<toolset>gcc:<cxxflags>-Wno-multichar
<toolset>gcc:<cxxflags>-Wno-strict-aliasing
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
;
rule windows-additional-properties
{
ADDITIONAL_LIB_PROPERTIES += <link>shared:<define>PROTEAN_DYN_LINK ;
ADDITIONAL_LIB_PROPERTIES += <link>shared:<define>BOOST_ALL_DYN_LINK ;
}
switch [ os.name ]
{
case "CYGWIN" :
windows-additional-properties ;
case "NT" :
windows-additional-properties ;
case "LINUX" :
}
if $(XERCES_BINARY)
{
lib xerces : : <name>$(XERCES_BINARY) <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
ADDIONAL_LIB_PROPERTIES += <define>XERCES_BINARY=$(XERCES_BINARY) ;
}
else
{
switch [ os.name ]
{
case "CYGWIN" :
lib xerces : : <toolset>gcc <name>xerces-c <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
lib xerces : : <toolset>msvc <variant>debug <name>xerces-c_3D <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
lib xerces : : <toolset>msvc <variant>release <name>xerces-c_3 <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
ADDITIONAL_LIB_PROPERTIES += <include>$(XERCES_INCLUDE) <search>$(XERCES_LIB) ;
case "NT" :
lib xerces : : <variant>debug <name>xerces-c_3D <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
lib xerces : : <variant>release <name>xerces-c_3 <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
ADDITIONAL_LIB_PROPERTIES += <include>$(XERCES_INCLUDE) <search>$(XERCES_LIB) ;
case "LINUX" :
lib pthread : : <name>pthread ;
lib xerces : pthread/<link>shared : <name>xerces-c <search>$(XERCES_LIBPATH) : : <include>$(XERCES_INCLUDE) ;
XERCES_BJAM_NAME = xerces ;
case * :
EXIT Protean: unknown os, please set either XERCES_BINARY or NO_XERCES ;
}
}
DEPENDENTONXERCES =
src/xml_reader.cpp src/xml_parser.cpp src/xml_writer.cpp test/core/test_xml_streams.cpp
protean/xml_reader.hpp protean/xml_parser.hpp protean/xml_writer.hpp protean/xml_defs.hpp
src/xml_writer_impl.cpp src/xml_handler_base.cpp src/xml_default_handler.cpp
src/xml_preserve_handler.cpp
;
if $(NO_XERCES) = 1
{
EXCLUDE += $(DEPENDENTONXERCES) ;
ADDIONAL_LIB_PROPERTIES += <define>NO_XERCES ;
ECHO Protean: Building without Xerces support because NO_XERCES is set ;
}
else
{
XERCES_NAME_FOR_UNIT_TESTS = xerces ;
if ! $(XERCES_INCLUDE)
{
EXIT Protean: XERCES_INCLUDE needs to be set if NO_XERCES is not 1 ;
}
}
rule protean_tag ( name : type ? : property-set )
{
return [ common.format-name
<base> <toolset> <threading> <runtime> -$(PROTEAN_VERSION)
: $(name) : $(type) : $(property-set) ] ;
}
lib protean
:
[ glob src/*.cpp : $(EXCLUDE) ]
/boost//filesystem
/boost//date_time
/boost//regex
/boost//system
/boost//iostreams
$(XERCES_BJAM_NAME)
:
<library-path>$(XERCES_LIBPATH)
<library-path>$(BOOST_LIB)
<include>.
$(ADDITIONAL_LIB_PROPERTIES)
<define>PROTEAN_SOURCE
<tag>@protean_tag
: :
<include>.
;
rule test-properties ( properties * )
{
local result ;
if [ os.name ] = "CYGWIN" || [ os.name ] = "NT"
{
if <link>shared in $(properties)
{
result += <define>PROTEAN_DYN_LINK ;
}
}
return $(result) ;
}
rule test-protean ( properties * : name )
{
return [
unit-test
protean-unit-tests-$(name)
:
[ glob test/core/*.cpp : $(EXCLUDE) ]
protean
/boost//unit_test_framework
$(XERCES_NAME_FOR_UNIT_TESTS)
:
<library-path>$(XERCES_LIBPATH)
<library-path>$(BOOST_LIB)
<conditional>@test-properties
:
:
] ;
}
install-libdir = build/lib ;
install-includedir = build/include ;
rule all-variants ( rulename )
{
$(rulename) <link>static <variant>release : t1 ;
$(rulename) <link>static <variant>debug : t2 ;
$(rulename) <link>shared <variant>release : t3 ;
$(rulename) <link>shared <variant>debug : t4 ;
}
rule install-lib ( properties * : name )
{
return [
install
install-$(name)
: protean
: <location>$(install-libdir)
#<install-dependencies>on
$(properties)
] ;
}
rule install-headers
{
all_headers = [ glob-tree *.hpp : .svn ] [ glob-tree *.ipp : .svn ] ;
protean_headers = [ MATCH (protean/.*) : $(all_headers) ] ;
install
headers
:
$(protean_headers)
:
<location>$(install-includedir)/protean
<install-source-root>protean
;
}
rule install-protean
{
install-headers ;
all-variants install-lib ;
}
all-variants test-protean ;
install-protean ;