mirror of
https://github.com/boostorg/build.git
synced 2026-02-01 08:22:15 +00:00
30 lines
697 B
Plaintext
30 lines
697 B
Plaintext
import type ;
|
|
import generators ;
|
|
import os ;
|
|
import print ;
|
|
|
|
type.register FOO : foo ;
|
|
|
|
generators.register-standard foo.foo : FOO : CPP H ;
|
|
|
|
nl = "
|
|
" ;
|
|
|
|
rule foo ( targets * : sources * : properties * )
|
|
{
|
|
# On NT, you need an exported symbol in order to have an
|
|
# import lib generated
|
|
# We won't really use the symbol defined here, just force
|
|
# lib creation.
|
|
if ( [ os.name ] = NT || [ modules.peek : OS ] in CYGWIN )
|
|
&& <main-target-type>LIB in $(properties)
|
|
{
|
|
.decl = "void __declspec(dllexport) foo(){}" ;
|
|
}
|
|
|
|
print.output $(<[1]) ;
|
|
print.text $(.decl:E="//")$(nl) ;
|
|
print.output $(<[2]) ;
|
|
print.text "#include <z.h>"$(nl) ;
|
|
}
|