[Buildroot] [PATCH v3 1/1] opentracing-cpp: new package

Samuel Martin s.martin49 at gmail.com
Wed Jan 3 20:37:03 UTC 2018


Hi all,

Apologies for being late back in this thread :-/

On Wed, Jan 3, 2018 at 11:10 AM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Hello,
>
> On Wed, 3 Jan 2018 11:50:32 +0200, Baruch Siach wrote:
>> Hi Jan,
>>
>> On Wed, Jan 03, 2018 at 10:07:51AM +0100, Jan Heylen wrote:
>> > I copied that infra from another package. Thomas also indicated already
>> > that there is something already generalised but not fully yet. So he
>> > adviced to keep it like this for the time being. If this is not nok, please
>> > advice differently.
>>
>> I see that rabbitmq-c is also doing that. I think that the -DBUILD_SHARED_LIBS
>> part is redundant. But the -DBUILD_STATIC_LIBS part might be needed, since the
>> generic code does not handle that.
>
> The generic code in pkg-cmake.mk is indeed not very consistent. It is
> strange to pass BUILD_SHARED_LIBS, but not BUILD_STATIC_LIBS.

Well, I think the code in pkg-cmake.mk has been done to stick as close
as possible to what is the default behavior of CMake.
But, it is true its default behavior is not really consistent since
CMake only offers a boolean variable driving the way the libraries are
built (see [1])

>
> On the other hand, there doesn't seem to be a real standardization of
> such options in the CMake world. I.e it's really up to each individual
> package to obey to BUILD_SHARED_LIBS/BUILD_STATIC_LIBS, and many CMake
> packages have their own custom options to enable/disable shared/static
> library build.
>
> But I guess for the sake of consistency pkg-cmake.mk should also pass
> BUILD_STATIC_LIBS, and we should accordingly cleanup the CMake packages
> that rely on BUILD_SHARED_LIBS/BUILD_STATIC_LIBS to not pass them
> explicitly, and rely on what the pkg-cmake infra is doing.

Adding BUILD_STATIC_LIBS will make thing a bit nicer (at least
symetric), though it is not standard in any way, which means some
projects may choose another name for a similar option and there is not
much we can do about this.

BTW, some projects still seems ignoring the existence of the
BUILD_SHARED_LIBS variable since they add a similar option with a
different name.


[1] https://cmake.org/cmake/help/v3.8/manual/cmake-variables.7.html#variables-that-change-behavior

Regards,

-- 
Samuel



More information about the buildroot mailing list