mirror of
https://github.com/boostorg/config.git
synced 2025-07-31 04:47:16 +02:00
Initial commit.
[SVN r36194]
This commit is contained in:
94
test/link/test/Jamfile.v2
Normal file
94
test/link/test/Jamfile.v2
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
|
||||||
|
import type ;
|
||||||
|
|
||||||
|
type.register AUTOLINK_LIB ;
|
||||||
|
|
||||||
|
import generators ;
|
||||||
|
import "class" : new ;
|
||||||
|
|
||||||
|
# This generator creates library using standard generators,
|
||||||
|
# and then add <library-path> usage requirements with the
|
||||||
|
# path of the created library.
|
||||||
|
class autolink-generator : generator
|
||||||
|
{
|
||||||
|
import generators ;
|
||||||
|
import "class" ;
|
||||||
|
import property-set ;
|
||||||
|
import path ;
|
||||||
|
|
||||||
|
rule run ( project name ? : property-set : sources + )
|
||||||
|
{
|
||||||
|
local result = [ generators.construct $(project) $(name)
|
||||||
|
: LIB : $(property-set) : $(sources) ] ;
|
||||||
|
|
||||||
|
local targets ;
|
||||||
|
local usage-requirements ;
|
||||||
|
|
||||||
|
if [ class.is-a $(result[1]) : property-set ]
|
||||||
|
{
|
||||||
|
usage-requirements = $(result[1]) ;
|
||||||
|
targets = $(result[2-]) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usage-requirements = [ property-set.empty ] ;
|
||||||
|
targets = $(result) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
local extra ;
|
||||||
|
local paths ;
|
||||||
|
local pwd = [ path.pwd ] ;
|
||||||
|
for local t in $(targets)
|
||||||
|
{
|
||||||
|
if [ type.is-derived [ $(t).type ] LIB ]
|
||||||
|
{
|
||||||
|
paths += [ path.root [ path.make [ $(t).path ] ] $(pwd) ] ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extra += $(paths:G=<library-path>) ;
|
||||||
|
if $(extra)
|
||||||
|
{
|
||||||
|
extra = [ sequence.unique $(extra) ] ;
|
||||||
|
usage-requirements = [ $(usage-requirements).add-raw $(extra) ] ;
|
||||||
|
}
|
||||||
|
return $(usage-requirements) $(targets) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
generators.register [
|
||||||
|
new autolink-generator $(__name__).autolink : : AUTOLINK_LIB ] ;
|
||||||
|
|
||||||
|
project : requirements -<threading>multi <hardcode-dll-paths>false ;
|
||||||
|
|
||||||
|
autolink-lib link_test : ../link_test.cpp
|
||||||
|
: <link>shared:<define>BOOST_DYN_LINK=1
|
||||||
|
:
|
||||||
|
;
|
||||||
|
|
||||||
|
explicit link_test ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <link>static <runtime-link>static <threading>single debug : link_test_static_single_debug ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <link>static <runtime-link>static <threading>single release : link_test_static_single_release ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <link>static <runtime-link>static <threading>multi debug : link_test_static_multi_debug ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <link>static <runtime-link>static <threading>multi release : link_test_static_multi_release ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <link>static <runtime-link>shared <threading>multi debug : link_test_dyn_multi_debug ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <link>static <runtime-link>shared <threading>multi release : link_test_dyn_multi_release ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>multi debug : link_test_dll_dyn_multi_debug ;
|
||||||
|
|
||||||
|
run ../main.cpp link_test
|
||||||
|
: : : <define>BOOST_DYN_LINK=1 <link>shared <runtime-link>shared <threading>multi release : link_test_dll_dyn_multi_release ;
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user