All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 1/2] pkg-cmake: make BUILD_SHARED_LIBS part of generic cmake pkg logic
Date: Wed, 3 Jan 2018 21:37:47 +0100	[thread overview]
Message-ID: <20180103213747.0edd0567@windsurf.lan> (raw)
In-Reply-To: <1515010165-25315-2-git-send-email-heyleke@gmail.com>

Hello,

On Wed,  3 Jan 2018 21:09:24 +0100, Jan Heylen wrote:
> From: Jan Heylen <jan.heylen@nokia.com>
> 
> Signed-off-by: Jan Heylen <jan.heylen@nokia.com>

This commit really needs a better description as to why we are doing
this.


> +ifeq ($(BR2_STATIC_LIBS),y)
> +CMAKE_BUILD_SHARED_LIBS = OFF
> +CMAKE_BUILD_STATIC_LIBS = ON
> +else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
> +CMAKE_BUILD_SHARED_LIBS = ON
> +CMAKE_BUILD_STATIC_LIBS = ON
> +else ifeq ($(BR2_SHARED_LIBS),y)
> +CMAKE_BUILD_SHARED_LIBS = ON
> +CMAKE_BUILD_STATIC_LIBS = OFF

I don't think those intermediate variables are really useful.

> +endif
> +
>  #
>  # Configure step. Only define it if not already defined by the package
>  # .mk file. And take care of the differences between host and target
> @@ -96,7 +107,8 @@ define $(2)_CONFIGURE_CMDS
>  		-DBUILD_TEST=OFF \
>  		-DBUILD_TESTS=OFF \
>  		-DBUILD_TESTING=OFF \
> -		-DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
> +		-DBUILD_SHARED_LIBS=$$(CMAKE_BUILD_SHARED_LIBS) \
> +		-DBUILD_STATIC_LIBS=$$(CMAKE_BUILD_STATIC_LIBS) \

Indeed, you can just do:

		-DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
		-DBUILD_STATIC_LIBS=$$(if $$(BR2_SHARED_LIBS),OFF,ON)

and that's it.

> diff --git a/package/rabbitmq-c/rabbitmq-c.mk b/package/rabbitmq-c/rabbitmq-c.mk
> index eef09ec..5a34e53 100644
> --- a/package/rabbitmq-c/rabbitmq-c.mk
> +++ b/package/rabbitmq-c/rabbitmq-c.mk
> @@ -13,14 +13,6 @@ RABBITMQ_C_CONF_OPTS = \
>  	-DBUILD_API_DOCS=OFF \
>  	-DBUILD_TOOLS_DOCS=OFF
>  
> -ifeq ($(BR2_STATIC_LIBS),y)
> -RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON
> -else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
> -RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
> -else ifeq ($(BR2_SHARED_LIBS),y)
> -RABBITMQ_C_CONF_OPTS += -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
> -endif

This should be part of a separate commit, since it's a simplification
that follows the previous change.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2018-01-03 20:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 20:09 [Buildroot] [PATCH v4 0/2] Opentracing-cpp: new package Jan Heylen
2018-01-03 20:09 ` [Buildroot] [PATCH v4 1/2] pkg-cmake: make BUILD_SHARED_LIBS part of generic cmake pkg logic Jan Heylen
2018-01-03 20:37   ` Thomas Petazzoni [this message]
2018-01-03 20:09 ` [Buildroot] [PATCH v4 2/2] opentracing-cpp: new package Jan Heylen
2018-01-03 20:40   ` Thomas Petazzoni
2018-01-05 12:57     ` Jan Heylen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180103213747.0edd0567@windsurf.lan \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.