[Buildroot] [PATCH 1/1] package/belr: fix BR2_SHARED_STATIC_LIBS build

Peter Korsgaard peter at korsgaard.com
Mon Apr 11 07:16:02 UTC 2022


>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice at gmail.com> writes:

 > Fix the following build failure with BR2_SHARED_STATIC_LIBS:
 > CMake Error at src/CMakeLists.txt:56 (add_library):
 >   add_library cannot create target "belr" because another target with the
 >   same name already exists.  The existing target is a static library created
 >   in source directory

 > Fixes:
 >  - http://autobuild.buildroot.org/results/d1ef96c8f370b5a522985c37f1681dd10bbc15bb

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
 > ---
 >  package/belr/belr.mk | 2 +-
 >  1 file changed, 1 insertion(+), 1 deletion(-)

 > diff --git a/package/belr/belr.mk b/package/belr/belr.mk
 > index f243830a85..1a849328ec 100644
 > --- a/package/belr/belr.mk
 > +++ b/package/belr/belr.mk
 > @@ -18,7 +18,7 @@ BELR_CONF_OPTS = \
 >  ifeq ($(BR2_STATIC_LIBS),y)
 >  BELR_CONF_OPTS += -DENABLE_SHARED=OFF -DENABLE_STATIC=ON
 >  else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
 > -BELR_CONF_OPTS += -DENABLE_SHARED=ON -DENABLE_STATIC=ON
 > +BELR_CONF_OPTS += -DENABLE_SHARED=ON -DENABLE_STATIC=OFF
 >  else ifeq ($(BR2_SHARED_LIBS),y)
 >  BELR_CONF_OPTS += -DENABLE_SHARED=ON -DENABLE_STATIC=OFF
 >  endif

This makes the BR2_SHARED_STATIC_LIBS and BR2_SHARED_LIBS conditionals
the same, so I just changed it to:

ifeq ($(BR2_STATIC_LIBS),y)
BELR_CONF_OPTS += -DENABLE_SHARED=OFF -DENABLE_STATIC=ON
else
# cannot build static and shared together
BELR_CONF_OPTS += -DENABLE_SHARED=ON -DENABLE_STATIC=OFF
endif

And committed, thanks.

-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list