From ee2a039d45b627db0f33dbf49cd09c85ab9fa620 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 27 Jun 2010 11:58:24 +0000 Subject: Added samples building target git-svn-id: http://pugixml.googlecode.com/svn/trunk@542 99668b35-9821-0410-8761-19e4c4f06640 --- Jamfile.jam | 25 +++++++++++++++++++++++++ Jamrules.jam | 12 ++++++++++++ 2 files changed, 37 insertions(+) diff --git a/Jamfile.jam b/Jamfile.jam index 54326de..b636025 100644 --- a/Jamfile.jam +++ b/Jamfile.jam @@ -108,3 +108,28 @@ for CONFIG in $(CONFIGURATIONS) Documentation docs/manual.html : docs/manual.qbk ; Alias docs : docs/manual.html ; + +# samples +for SAMPLE in [ Glob docs/samples : *.cpp ] +{ + local CONFIG = "debug" ; + local DEFINES = "PUGIXML_STANDARD" ; + + # build folder + local CFGBUILD = $(BUILD)/$(toolset)/$(DEFINES:J=_)/$(CONFIG) ; + + # compilation options + local CFGFLAGS = $(CCFLAGS) [ GetCFlags $(CONFIG) : $(DEFINES) ] ; + CFGFLAGS += -I src ; + + # build and run sample + local EXECUTABLE = $(CFGBUILD)/samples/$(SAMPLE:S=.exe) ; + local PUGIXML = $(CFGBUILD)/pugixml.lib ; + + Application $(EXECUTABLE) : $(SAMPLE) : $(CFGFLAGS) : $(PUGIXML) ; + + RunSampleAction $(EXECUTABLE)_run : $(EXECUTABLE) ; + Depends $(EXECUTABLE)_run : $(EXECUTABLE) ; + + Depends samples : $(EXECUTABLE)_run ; +} diff --git a/Jamrules.jam b/Jamrules.jam index 6dfba7d..1efd90c 100644 --- a/Jamrules.jam +++ b/Jamrules.jam @@ -441,6 +441,12 @@ if ( $(UNIX) ) $(>) } + actions RunSampleAction + { + cd docs/samples + ../../$(>) + } + actions quietly ignore MakeDirAction { mkdir -p $(<) @@ -458,6 +464,12 @@ else $(>:\\) } + actions RunSampleAction + { + cd docs\samples + ..\..\$(>:\\) + } + actions quietly ignore MakeDirAction { mkdir $(<:\\) >nul 2>&1 -- cgit v1.2.3