mirror of
https://github.com/boostorg/build.git
synced 2026-01-25 06:02:12 +00:00
45 lines
759 B
Plaintext
45 lines
759 B
Plaintext
|
|
import property ;
|
|
|
|
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=) ;
|
|
}
|
|
}
|
|
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 $(<) $(>)
|
|
}
|
|
|