mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
28 lines
627 B
Plaintext
28 lines
627 B
Plaintext
import type ;
|
|
import generators ;
|
|
import os ;
|
|
|
|
type.register FOO : foo ;
|
|
|
|
generators.register-standard foo.foo : FOO : CPP H ;
|
|
|
|
rule foo ( targets * : sources * : properties * )
|
|
{
|
|
# On NT, you need an exported symbol in order to have an import lib generated
|
|
if [ os.name ] = NT && <main-target-type>LIB in $(properties)
|
|
{
|
|
.decl = "echo void __declspec(dllexport) foo(){}" ;
|
|
}
|
|
.decl1 on $(<) = $(.decl:E="echo //") ;
|
|
|
|
# Further files must be touched also; NT doesn't have a touch command
|
|
.decl2 on $(<) = "
|
|
echo // > " ;
|
|
}
|
|
|
|
actions foo
|
|
{
|
|
$(.decl1) > $(<[1]) $(.decl2)$(<[2-])
|
|
}
|
|
|