2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 00:12:11 +00:00

New features <warning> and <warnings-as-errors>.

Patch from Reece Dunn.


[SVN r31068]
This commit is contained in:
Vladimir Prus
2005-09-21 13:44:06 +00:00
parent 934e8eee9a
commit c888bb5647
5 changed files with 34 additions and 6 deletions

View File

@@ -67,6 +67,10 @@ flags borland CFLAGS <inlining>off : -vi- ;
flags borland CFLAGS <inlining>on : -vi -w-inl ;
flags borland CFLAGS <inlining>full : -vi -w-inl ;
flags borland.compile OPTIONS <warnings>off : -w- ;
flags borland.compile OPTIONS <warnings>all : -w ;
flags borland.compile OPTIONS <warnings-as-errors>on : -w! ;
# Deal with various runtime configs...
@@ -99,7 +103,6 @@ flags borland NEED_IMPLIB <main-target-type>LIB/<link>shared : "" ;
# -q no banner
# -c compile to object
# -P C++ code regardless of file extention
# -w turns on all warnings
# -Ve zero sized empty base classes, this option is on in the IDE by default
# and effects binary compatibility.
# -Vx zero sized empty members, this option is on in the IDE by default
@@ -113,13 +116,13 @@ flags borland NEED_IMPLIB <main-target-type>LIB/<link>shared : "" ;
actions compile.c++
{
"$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -w -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
"$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
}
# For C, we don't pass -P flag
actions compile.c
{
"$(CONFIG_COMMAND)" -j5 -g255 -q -c -w -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
"$(CONFIG_COMMAND)" -j5 -g255 -q -c -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
}

View File

@@ -79,6 +79,17 @@ feature use : : free dependency incidental ;
feature dependency : : free dependency incidental ;
feature implicit-dependency : : free dependency incidental ;
feature warnings :
all # enable all warnings issued by the tool
on # enable default warning level for the tool
off # disable all warnings issued by the tool
: incidental ;
feature warnings-as-errors :
off # do not fail the compilation if there are warnings
on # fail the compilation if there are warnings
: incidental ;
feature source : : free dependency incidental ;
feature library : : free dependency incidental ;
feature file : : free dependency incidental ;

View File

@@ -133,6 +133,11 @@ flags cw.compile CFLAGS <inlining>full : -inline all ;
flags cw.compile CFLAGS <exception-handling>off : -Cpp_exceptions off ;
flags cw.compile CFLAGS <rtti>off : -RTTI off ;
flags cw.compile CFLAGS <warnings>on : -w on ;
flags cw.compile CFLAGS <warnings>off : -w off ;
flags cw.compile CFLAGS <warnings>all : -w all ;
flags cw.compile CFLAGS <warnings-as-errors>on : -w error ;
flags cw.compile USER_CFLAGS <cflags> : ;
flags cw.compile.c++ USER_CFLAGS <cxxflags> : ;

View File

@@ -78,6 +78,10 @@ flags gcc.compile OPTIONS <inlining>off : -fno-inline ;
flags gcc.compile OPTIONS <inlining>on : -Wno-inline ;
flags gcc.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
flags gcc.compile OPTIONS <warnings>off : -w ;
flags gcc.compile OPTIONS <warnings>all : -Wall ;
flags gcc.compile OPTIONS <warnings-as-errors>on : -Werror ;
flags gcc.compile OPTIONS <debug-symbols>on : -g ;
flags gcc.compile OPTIONS <profiling>on : -pg ;
# On cygwin and mingw, gcc generates position independent code by default,
@@ -134,7 +138,7 @@ rule compile.c++
actions compile.c++
{
"$(CONFIG_COMMAND)" $(LANG) -Wall -ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
"$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
rule compile.c
@@ -151,7 +155,7 @@ rule compile.c
actions compile.c
{
"$(CONFIG_COMMAND)" $(LANG) -Wall $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
"$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
rule compile.asm
@@ -161,7 +165,7 @@ rule compile.asm
actions compile.asm
{
"$(CONFIG_COMMAND)" $(LANG) -Wall $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
"$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
# The class which check that we don't try to use

View File

@@ -268,6 +268,11 @@ flags msvc.compile CFLAGS <inlining>off : /Ob0 ;
flags msvc.compile CFLAGS <inlining>on : /Ob1 ;
flags msvc.compile CFLAGS <inlining>full : /Ob2 ;
flags msvc.compile CFLAGS <warnings>on : /W3 ;
flags msvc.compile CFLAGS <warnings>off : /W0 ;
flags msvc.compile CFLAGS <warnings>all : /W4 /Wp64 ;
flags msvc.compile CFLAGS <warnings-as-errors>on : /WX ;
flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>off : /EHs ;
flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>on : /EHsc ;
flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>off : /EHa ;