Added MSVC building
git-svn-id: http://pugixml.googlecode.com/svn/trunk@186 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
9216c82cfd
commit
2a14a3b4c9
33
Jamfile.jam
33
Jamfile.jam
@ -1,17 +1,40 @@
|
|||||||
# Latest jamplus is needed to use this
|
# Latest jamplus is needed to use this
|
||||||
|
|
||||||
# Targets:
|
# Targets:
|
||||||
# pugixml - build pugixml library
|
# pugixml - build pugixml library
|
||||||
# tests - build pugixml test suite
|
# tests - build pugixml test suite
|
||||||
# run_tests - run pugixml test suite
|
# run_tests - run pugixml test suite
|
||||||
# coverage - get test suite coverage
|
# coverage - get test suite coverage
|
||||||
|
|
||||||
|
# Options:
|
||||||
|
# toolset=name - select toolset
|
||||||
|
# supported toolsets: mingw*, msvc*
|
||||||
|
|
||||||
|
# default toolset/configuration
|
||||||
|
if ( ! $(toolset) )
|
||||||
|
{
|
||||||
|
exit You should specify a toolset ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! $(configuration) )
|
||||||
|
{
|
||||||
|
configuration = "debug" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# options
|
||||||
|
BUILD = build/$(toolset)/$(configuration) ;
|
||||||
|
|
||||||
|
if ( $(toolset) = "mingw" )
|
||||||
|
{
|
||||||
|
CCFLAGS = -fprofile-arcs -ftest-coverage ;
|
||||||
|
LDFLAGS = -fprofile-arcs ;
|
||||||
|
GCOVFLAGS = -n ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# rules
|
||||||
include "Jamrules.jam" ;
|
include "Jamrules.jam" ;
|
||||||
|
|
||||||
BUILD = build/mingw/debug ;
|
# targets
|
||||||
CCFLAGS = -fprofile-arcs -ftest-coverage ;
|
|
||||||
LDFLAGS = -fprofile-arcs ;
|
|
||||||
GCOVFLAGS = -n ;
|
|
||||||
|
|
||||||
Library pugixml : src/pugixml.cpp src/pugixpath.cpp ;
|
Library pugixml : src/pugixml.cpp src/pugixpath.cpp ;
|
||||||
Application tests : tests/main.cpp [ Glob tests : test_*.cpp ] : pugixml ;
|
Application tests : tests/main.cpp [ Glob tests : test_*.cpp ] : pugixml ;
|
||||||
Test run_tests : tests ;
|
Test run_tests : tests ;
|
||||||
|
|||||||
77
Jamrules.jam
77
Jamrules.jam
@ -1,23 +1,74 @@
|
|||||||
# Rules for Jamfile.jam
|
# Rules for Jamfile.jam
|
||||||
|
|
||||||
actions ObjectAction
|
if ( $(toolset:I=^mingw) )
|
||||||
{
|
{
|
||||||
%MINGW_PATH%\bin\gcc -W -Wall -Wextra -Werror -pedantic -c $(>) -o $(<) $(CCFLAGS)
|
if ( $(configuration) = "debug" )
|
||||||
}
|
{
|
||||||
|
CCFLAGS += -D_DEBUG ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCFLAGS += -DNDEBUG -O3 ;
|
||||||
|
}
|
||||||
|
|
||||||
actions LibraryAction
|
actions ObjectAction
|
||||||
{
|
{
|
||||||
%MINGW_PATH%\bin\ar rc $(<) $(>)
|
%$(toolset)_PATH%\bin\gcc -W -Wall -Wextra -Werror -pedantic -c $(>) -o $(<) $(CCFLAGS)
|
||||||
|
}
|
||||||
|
|
||||||
|
actions LibraryAction
|
||||||
|
{
|
||||||
|
%$(toolset)_PATH%\bin\ar rc $(<) $(>)
|
||||||
|
}
|
||||||
|
|
||||||
|
actions LinkAction
|
||||||
|
{
|
||||||
|
%$(toolset)_PATH%\bin\g++ $(>) -o $(<) $(LDFLAGS)
|
||||||
|
}
|
||||||
|
|
||||||
|
actions CoverageAction
|
||||||
|
{
|
||||||
|
%$(toolset)_PATH%\bin\gcov $(>:\\) $(GCOVFLAGS) | perl tests/gcov-filter.pl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if ( $(toolset:I^=msvc) )
|
||||||
actions LinkAction
|
|
||||||
{
|
{
|
||||||
%MINGW_PATH%\bin\g++ $(>) -o $(<) $(LDFLAGS)
|
if ( $(configuration) = "debug" )
|
||||||
}
|
{
|
||||||
|
CCFLAGS += /D_DEBUG /MTd ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCFLAGS += /DNDEBUG /Ox /MT ;
|
||||||
|
}
|
||||||
|
|
||||||
actions CoverageAction
|
if ( $(toolset) != msvc6 )
|
||||||
{
|
{
|
||||||
%MINGW_PATH%\bin\gcov $(>:\\) $(GCOVFLAGS) | perl tests/gcov-filter.pl
|
CCFLAGS += /Wp64 /W4 ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CCFLAGS += /W3 ; # lots of warnings at W4 in standard library
|
||||||
|
}
|
||||||
|
|
||||||
|
actions ObjectAction
|
||||||
|
{
|
||||||
|
%$(toolset)_PATH%\bin\cl.exe /EHsc /WX /I%$(toolset)_PATH%\include /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
||||||
|
}
|
||||||
|
|
||||||
|
actions LibraryAction
|
||||||
|
{
|
||||||
|
%$(toolset)_PATH%\bin\lib.exe /NOLOGO /OUT:$(<) $(>)
|
||||||
|
}
|
||||||
|
|
||||||
|
actions LinkAction
|
||||||
|
{
|
||||||
|
%$(toolset)_PATH%\bin\link.exe /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) $(>) /LIBPATH:%$(toolset)_PATH%\lib /LIBPATH:%$(toolset)_PATH%\PlatformSDK\lib $(LDFLAGS)
|
||||||
|
}
|
||||||
|
|
||||||
|
actions CoverageAction
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actions RunAction
|
actions RunAction
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user