2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00
Files
build/gcc.jam
Vladimir Prus b53b5af5e0 Added hooks to allow special property adjustment for generators and actions.
For example, this would allow compilers to add generated headers into include
path.

	* virtual-target.jam (action.adjust-properties): New rule.
	  (clone-action-template): Don't slice cloned object.

	* generators.jam (generator.action-class): New rule, to allow
	  overriding action class on per-generator basis.

	* builtin.jam (compile-action): New class.
	    (C-compiling-generator): New class.

	* gcc.jam: Use C-compiling-generator for gcc. Honor includes.


[SVN r15618]
2002-10-01 16:31:31 +00:00

74 lines
1.4 KiB
Plaintext

import property ;
import generators ;
generators.register-composing gcc.link : STATIC-LIB OBJ : EXE : <toolset>gcc ;
generators.register-composing gcc.archive : OBJ : STATIC-LIB : <toolset>gcc ;
generators.register-composing gcc.link-dll : OBJ : SHARED-LIB : <toolset>gcc ;
generators.register-c-compiler gcc.compile : CPP : OBJ : <toolset>gcc ;
generators.register-c-compiler gcc.compile : C : OBJ : <toolset>gcc ;
rule compile ( target : sources * : property-set * )
{
local options ;
for local p in $(property-set)
{
if $(p) = <optimization>on
{
options += -O2 ;
}
else if $(p) = <debug-symbols>on
{
options += -g ;
}
else if $(p:G) = <define>
{
options += -D$(p:G=) ;
}
else if $(p:G) = <include>
{
options += -I$(p:G=) ;
}
}
OPTIONS on $(target) = $(options) ;
}
actions compile
{
g++ $(OPTIONS) -c -o $(<) $(>)
}
rule link ( target : sources * : property-set * )
{
local options ;
if <debug-symbols>on in $(property-set)
{
options += -g ;
}
OPTIONS on $(target) = $(options) ;
}
actions link
{
g++ $(OPTIONS) -o $(<) $(>)
}
rule archive ( target : sources * : property-set * )
{
}
actions archive
{
ar ur $(<) $(>)
}
rule link-dll ( target : sources * : property-set * )
{
}
actions link-dll
{
gcc -o $(<) -shared $(>)
}