Added support for different compilation modes

git-svn-id: http://pugixml.googlecode.com/svn/trunk@193 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2009-10-29 07:18:26 +00:00
parent 15a69d3510
commit 6210c21984
2 changed files with 42 additions and 4 deletions

View File

@ -21,8 +21,18 @@ if ( ! $(configuration) )
configuration = "debug" ; configuration = "debug" ;
} }
# remove empty define
defines -= "" ;
# options # options
BUILD = build/$(toolset)/$(configuration) ; if ( $(defines) )
{
BUILD = build/$(toolset)/$(defines:J=-)/$(configuration) ;
}
else
{
BUILD = build/$(toolset)/standard/$(configuration) ;
}
if ( $(toolset) = "mingw" ) if ( $(toolset) = "mingw" )
{ {

View File

@ -2,6 +2,8 @@
if ( $(toolset:I=^mingw) ) if ( $(toolset:I=^mingw) )
{ {
CCFLAGS += -D$(defines) ;
if ( $(configuration) = "debug" ) if ( $(configuration) = "debug" )
{ {
CCFLAGS += -D_DEBUG ; CCFLAGS += -D_DEBUG ;
@ -11,6 +13,11 @@ if ( $(toolset:I=^mingw) )
CCFLAGS += -DNDEBUG -O3 ; CCFLAGS += -DNDEBUG -O3 ;
} }
if ( PUGIXML_NO_EXCEPTIONS in $(defines) )
{
CCFLAGS += -fno-exceptions ;
}
actions ObjectAction actions ObjectAction
{ {
"%$(toolset)_PATH%\bin\gcc" -W -Wall -Wextra -Werror -pedantic -c $(>) -o $(<) $(CCFLAGS) "%$(toolset)_PATH%\bin\gcc" -W -Wall -Wextra -Werror -pedantic -c $(>) -o $(<) $(CCFLAGS)
@ -33,6 +40,8 @@ if ( $(toolset:I=^mingw) )
} }
else if ( $(toolset:I=^msvc) ) else if ( $(toolset:I=^msvc) )
{ {
CCFLAGS += /D$(defines) ;
if ( $(configuration) = "debug" ) if ( $(configuration) = "debug" )
{ {
CCFLAGS += /D_DEBUG /MTd ; CCFLAGS += /D_DEBUG /MTd ;
@ -51,9 +60,14 @@ else if ( $(toolset:I=^msvc) )
CCFLAGS += /W3 ; # lots of warnings at W4 in standard library CCFLAGS += /W3 ; # lots of warnings at W4 in standard library
} }
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(defines) ) )
{
CCFLAGS += /EHsc ;
}
actions ObjectAction actions ObjectAction
{ {
"%$(toolset)_PATH%\bin\cl.exe" /EHsc /WX /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS) "%$(toolset)_PATH%\bin\cl.exe" /WX /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
} }
actions LibraryAction actions LibraryAction
@ -74,6 +88,8 @@ else if ( $(toolset) = "ic8" )
{ {
msvc = "msvc7" ; msvc = "msvc7" ;
CCFLAGS += /D$(defines) ;
if ( $(configuration) = "debug" ) if ( $(configuration) = "debug" )
{ {
CCFLAGS += /D_DEBUG /MTd ; CCFLAGS += /D_DEBUG /MTd ;
@ -83,9 +99,14 @@ else if ( $(toolset) = "ic8" )
CCFLAGS += /DNDEBUG /Ox /MT ; CCFLAGS += /DNDEBUG /Ox /MT ;
} }
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(defines) ) )
{
CCFLAGS += /EHsc ;
}
actions ObjectAction actions ObjectAction
{ {
"%$(toolset)_PATH%\bin\icl.exe" /EHsc /W4 /WX /Wport /Qwd981,444,280,383,909,304,167 /I"%$(msvc)_PATH%\include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS) "%$(toolset)_PATH%\bin\icl.exe" /W4 /WX /Wport /Qwd981,444,280,383,909,304,167 /I"%$(msvc)_PATH%\include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
} }
actions LibraryAction actions LibraryAction
@ -104,6 +125,8 @@ else if ( $(toolset) = "ic8" )
} }
else if ( $(toolset:I=^dmc) ) else if ( $(toolset:I=^dmc) )
{ {
CCFLAGS += -D$(defines) ;
if ( $(configuration) = "debug" ) if ( $(configuration) = "debug" )
{ {
CCFLAGS += -D_DEBUG ; CCFLAGS += -D_DEBUG ;
@ -113,9 +136,14 @@ else if ( $(toolset:I=^dmc) )
CCFLAGS += -DNDEBUG ; CCFLAGS += -DNDEBUG ;
} }
if ( !(PUGIXML_NO_EXCEPTIONS in $(defines)) )
{
CCFLAGS += -Ae ;
}
actions ObjectAction actions ObjectAction
{ {
"%$(toolset)_PATH%\bin\dmc.exe" -c -f -wx -Ae $(>) -o$(<) "%$(toolset)_PATH%\bin\dmc.exe" -c -f -wx $(>) -o$(<)
} }
actions LibraryAction actions LibraryAction