build lib/dll

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

build lib/dll

Gennadiy Rozental
Getting started question: how to build only lib or only dll?

Gennadiy



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Daniel Einspanjer
"Gennadiy Rozental" <[hidden email]> wrote in message
news:dtvro7$7l6$[hidden email]...
> Getting started question: how to build only lib or only dll?


That is controlled by the <link> feature.  <link>shared or <link>static

For a given lib target, you can specify your preference in the requirements
section.

# builds a static lib
lib foo
    : # sources
        test.cpp
    : # requirements
        <link>static
    ;

# builds a "dll"
lib bar
    : # sources
        test.cpp
    : # requirements
        <link>shared
    ;

You could also specify the requirement in a project if you wanted all libs
to be built a particular way.

# In Jamroot
project
    : requirements
        <link>static
    ;

Finally, if you haven't made it an explicit requirement (which I don't
believe can be overridden) then you can specify a different value for the
feature on the command line. e.g. If none of the <link> lines were in the
targets above, you could run
bjam link=static
and you would get static libs instead of the default shared.

You could even run
bjam link=static link=shared
And it would build both libs and dlls.

hth,
Daniel Einspanjer


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Gennadiy Rozental

"Daniel Einspanjer" <[hidden email]> wrote in message
news:dtvus9$ij4$[hidden email]...
> "Gennadiy Rozental" <[hidden email]> wrote in message
> news:dtvro7$7l6$[hidden email]...
>> Getting started question: how to build only lib or only dll?

[...]  // Non -build command staff skipped

> Finally, if you haven't made it an explicit requirement (which I don't
> believe can be overridden) then you can specify a different value for the
> feature on the command line. e.g. If none of the <link> lines were in the
> targets above, you could run
> bjam link=static
> and you would get static libs instead of the default shared.
>
> You could even run
> bjam link=static link=shared
> And it would build both libs and dlls.


doesn't seems to work

bjam "-sBUILD=<link>shared" boost_unit_test_framework

builds both static and dynamic libs

Gennadiy




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Daniel Einspanjer
"Gennadiy Rozental" <[hidden email]> wrote in message
news:du1v3s$orh$[hidden email]...

>> You could even run
>> bjam link=static link=shared
>> And it would build both libs and dlls.
>
>
> doesn't seems to work
>
> bjam "-sBUILD=<link>shared" boost_unit_test_framework
>
> builds both static and dynamic libs
>

Very sorry, I was dealing with Boost v2 syntax.

Daniel


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Gennadiy Rozental
>> bjam "-sBUILD=<link>shared" boost_unit_test_framework
>>
>> builds both static and dynamic libs
>>
>
> Very sorry, I was dealing with Boost v2 syntax.

So how would proper command look with v1?

Gennadiy



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Vladimir Prus
On Wednesday 01 March 2006 04:20, Gennadiy Rozental wrote:
> >> bjam "-sBUILD=<link>shared" boost_unit_test_framework
> >>
> >> builds both static and dynamic libs
> >
> > Very sorry, I was dealing with Boost v2 syntax.
>
> So how would proper command look with v1?

In V1, a given target is either static library, or a shared library. The
ability to select between static and shared linking was added only in V2.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Gennadiy Rozental

"Vladimir Prus" <[hidden email]> wrote in message
news:[hidden email]...

> On Wednesday 01 March 2006 04:20, Gennadiy Rozental wrote:
>> >> bjam "-sBUILD=<link>shared" boost_unit_test_framework
>> >>
>> >> builds both static and dynamic libs
>> >
>> > Very sorry, I was dealing with Boost v2 syntax.
>>
>> So how would proper command look with v1?
>
> In V1, a given target is either static library, or a shared library. The
> ability to select between static and shared linking was added only in V2.

Hmm. In Boost.Test Jamfile I've got both dll and lib
boost_unit_test_framework. So you are saying there is no way to just compile
one of them?

Gennadiy



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: build lib/dll

Vladimir Prus
On Wednesday 01 March 2006 18:23, Gennadiy Rozental wrote:

> "Vladimir Prus" <[hidden email]> wrote in message
> news:[hidden email]...
>
> > On Wednesday 01 March 2006 04:20, Gennadiy Rozental wrote:
> >> >> bjam "-sBUILD=<link>shared" boost_unit_test_framework
> >> >>
> >> >> builds both static and dynamic libs
> >> >
> >> > Very sorry, I was dealing with Boost v2 syntax.
> >>
> >> So how would proper command look with v1?
> >
> > In V1, a given target is either static library, or a shared library. The
> > ability to select between static and shared linking was added only in V2.
>
> Hmm. In Boost.Test Jamfile I've got both dll and lib
> boost_unit_test_framework. So you are saying there is no way to just
> compile one of them?

Well, I don't know any. Maybe Rene can suggest something.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build