2009-10-10 20:14:04 +00:00
|
|
|
# Latest jamplus is needed to use this
|
2009-10-28 20:08:43 +00:00
|
|
|
|
2009-10-10 20:14:04 +00:00
|
|
|
# Targets:
|
|
|
|
# pugixml - build pugixml library
|
|
|
|
# tests - build pugixml test suite
|
|
|
|
# run_tests - run pugixml test suite
|
|
|
|
# coverage - get test suite coverage
|
|
|
|
|
2009-10-28 20:08:43 +00:00
|
|
|
# Options:
|
|
|
|
# toolset=name - select toolset
|
|
|
|
# supported toolsets: mingw*, msvc*
|
|
|
|
|
|
|
|
# default toolset/configuration
|
|
|
|
if ( ! $(toolset) )
|
|
|
|
{
|
2010-04-20 20:46:18 +00:00
|
|
|
if ( $(UNIX) )
|
|
|
|
{
|
|
|
|
toolset = "gcc" ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
exit You should specify a toolset ;
|
|
|
|
}
|
2009-10-28 20:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $(configuration) )
|
|
|
|
{
|
|
|
|
configuration = "debug" ;
|
|
|
|
}
|
2009-10-10 20:14:04 +00:00
|
|
|
|
2010-05-06 20:28:36 +00:00
|
|
|
# split defines into list
|
|
|
|
defines = [ Split $(defines) : ',' ] ;
|
2009-10-29 07:18:26 +00:00
|
|
|
|
2009-10-28 20:08:43 +00:00
|
|
|
# options
|
2009-10-29 07:18:26 +00:00
|
|
|
if ( $(defines) )
|
|
|
|
{
|
2009-10-29 21:47:37 +00:00
|
|
|
BUILD = build/$(toolset)/$(defines:J=_)/$(configuration) ;
|
2009-10-29 07:18:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BUILD = build/$(toolset)/standard/$(configuration) ;
|
|
|
|
}
|
2009-10-28 20:08:43 +00:00
|
|
|
|
2010-05-06 20:28:36 +00:00
|
|
|
if ( $(toolset:I=^mingw) || $(toolset) = gcc )
|
2009-10-28 20:08:43 +00:00
|
|
|
{
|
|
|
|
CCFLAGS = -fprofile-arcs -ftest-coverage ;
|
|
|
|
LDFLAGS = -fprofile-arcs ;
|
|
|
|
GCOVFLAGS = -n ;
|
2009-11-04 20:52:27 +00:00
|
|
|
|
2010-05-06 20:28:36 +00:00
|
|
|
GCOVFLAGS += -o $(BUILD)/src ; # because stupid gcov can't find files via relative paths
|
2009-10-28 20:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# rules
|
|
|
|
include "Jamrules.jam" ;
|
2009-10-10 20:14:04 +00:00
|
|
|
|
2010-05-06 20:28:36 +00:00
|
|
|
# enable dependency cache
|
|
|
|
DEPCACHE.standard = build/.depcache ;
|
|
|
|
|
2009-10-28 20:08:43 +00:00
|
|
|
# targets
|
2009-10-10 20:14:04 +00:00
|
|
|
Library pugixml : src/pugixml.cpp src/pugixpath.cpp ;
|
2010-05-06 20:28:36 +00:00
|
|
|
Application tests : [ Glob tests : *.cpp ] : pugixml ;
|
2009-10-10 20:14:04 +00:00
|
|
|
Test run_tests : tests ;
|
2010-05-06 20:28:36 +00:00
|
|
|
Coverage coverage : pugixml ;
|
|
|
|
Depends coverage : run_tests ;
|