From 373fb6f76962caca9da109d4fe1e820af996326d Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Sat, 14 Jan 2017 11:59:31 +0100 Subject: [PATCH] Do not reuse the same target for different library link checks --- src/build/ac.jam | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/build/ac.jam b/src/build/ac.jam index c6e36c6a5..c01dc5997 100644 --- a/src/build/ac.jam +++ b/src/build/ac.jam @@ -76,14 +76,6 @@ rule construct-library ( name : property-set : provided-path ? ) rule find-library ( properties : names + : provided-path ? ) { local result ; - if ! $(.main.cpp) - { - local a = [ class.new action : ac.generate-main : - [ property-set.empty ] ] ; - .main.cpp = [ virtual-target.register - [ class.new file-target main.cpp exact - : CPP : $(.project) : $(a) ] ] ; - } if [ $(properties).get ] = shared { link-opts = shared static ; @@ -100,8 +92,12 @@ rule find-library ( properties : names + : provided-path ? ) { local name = $(names-iter[1]) ; local lib = [ construct-library $(name) : $(properties) : $(provided-path) ] ; + local a = [ class.new action : ac.generate-main : + [ property-set.empty ] ] ; + local main.cpp = [ virtual-target.register + [ class.new file-target main-$(name).cpp exact : CPP : $(.project) : $(a) ] ] ; local test = [ generators.construct $(.project) $(name) : EXE - : [ $(properties).add $(lib[1]) ] : $(.main.cpp) $(lib[2-]) + : [ $(properties).add $(lib[1]) ] : $(main.cpp) $(lib[2-]) : true ] ; local jam-targets ; for t in $(test[2-])