![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/boost-build/src/tools/generators/ |
Upload File : |
# Copyright 2002-2017 Rene Rivera # Copyright 2002-2017 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import "class" : new ; import generators ; # The generator class for handling STATIC_LIB creation. # class archive-generator : generator { import generators ; import property-set ; rule __init__ ( id composing ? : source-types + : target-types + : requirements * ) { composing ?= true ; generator.__init__ $(id) $(composing) : $(source-types) : $(target-types) : $(requirements) ; } rule run ( project name ? : property-set : sources + ) { sources += [ $(property-set).get <library> ] ; property-set = [ $(property-set).add-raw <relevant>link ] ; local result = [ generator.run $(project) $(name) : $(property-set) : $(sources) ] ; # For static linking, if we get a library in source, we can not directly # link to it so we need to cause our dependencies to link to that # library. There are two approaches: # - adding the library to the list of returned targets. # - using the <library> usage requirements. # The problem with the first is: # # lib a1 : : <file>liba1.a ; # lib a2 : a2.cpp a1 : <link>static ; # install dist : a2 ; # # here we will try to install 'a1', even though it is not necessary in # the general case. With the second approach, even indirect dependants # will link to the library, but it should not cause any harm. So, return # all LIB sources together with created targets, so that dependants link # to them. local usage-requirements = <relevant>link ; if [ $(property-set).get <link> ] = static { for local t in $(sources) { if [ type.is-derived [ $(t).type ] LIB ] { usage-requirements += <library>$(t) ; } } } return [ generators.add-usage-requirements $(result) : $(usage-requirements) ] ; } } rule register-archiver ( id composing ? : source-types + : target-types + : requirements * ) { generators.register [ new archive-generator $(id) $(composing) : $(source-types) : $(target-types) : $(requirements) ] ; } IMPORT $(__name__) : register-archiver : : generators.register-archiver ;