Skip to content

Commit

Permalink
makes: binary.mk: introduce LOCAL_LDLIBS
Browse files Browse the repository at this point in the history
JIRA: CI-334
  • Loading branch information
nalajcie committed Sep 1, 2023
1 parent 12d322c commit 5719a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions makes/binary.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# - LOCAL_CFLAGS - additional CFLAGS for current component compilation
# - LOCAL_CXXFLAGS - additional CXXFLAGS for current component compilation
# - LOCAL_LDFLAGS - additional LDFLAGS for current component linking
# - LOCAL_LDLIBS - additional LDLIBS for current component linking
# - LOCAL_INSTALL_PATH - custom rootfs dir for the binary to be installed (if not provided - DEFAULT_INSTALL_PATH)

# Global variables (not reset by this script):
Expand Down Expand Up @@ -51,6 +52,7 @@ $(OBJS.$(NAME)): | $(DEPS)
$(OBJS.$(NAME)): CFLAGS:=-I"$(ABS_HEADERS_DIR)" $(CFLAGS) $(LOCAL_CFLAGS)
$(OBJS.$(NAME)): CXXFLAGS:=-I"$(ABS_HEADERS_DIR)" $(CXXFLAGS) $(LOCAL_CXXFLAGS)
$(PREFIX_PROG)$(NAME): LDFLAGS:=$(LDFLAGS) $(LOCAL_LDFLAGS)
$(PREFIX_PROG)$(NAME): LDLIBS:=$(LOCAL_LDLIBS) $(LDLIBS)

# dynamically generated dependencies (file-to-file dependencies)
DEPS.$(NAME) := $(patsubst %,$(PREFIX_O)%.d,$(SRCS))
Expand Down Expand Up @@ -122,4 +124,5 @@ LIBS :=
LOCAL_CFLAGS :=
LOCAL_CXXFLAGS :=
LOCAL_LDFLAGS :=
LOCAL_LDLIBS :=
LOCAL_INSTALL_PATH :=
3 changes: 2 additions & 1 deletion makes/static-lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ endif

# binary.mk clears all variables it uses so we should expect that they are not set here. Leaving them set would
# influence next binary.mk call leading to unexpected errors
ifneq ($(DEP_LIB)$(LIBS)$(LOCAL_LDFLAGS)$(LOCAL_INSTALL_PATH),)
ifneq ($(DEP_LIB)$(LIBS)$(LOCAL_LDFLAGS)$(LOCAL_LDLIBS)$(LOCAL_INSTALL_PATH),)
$(warning $(NAME): DEP_LIB=$(DEP_LIB))
$(warning $(NAME): LIBS=$(LIBS))
$(warning $(NAME): LOCAL_LDFLAGS=$(LOCAL_LDFLAGS))
$(warning $(NAME): LOCAL_LDLIBS=$(LOCAL_LDLIBS))
$(warning $(NAME): LOCAL_INSTALL_PATH=$(LOCAL_INSTALL_PATH))
$(error $(NAME): static-lib.mk invoked with args reserved for binary.mk)
endif
Expand Down

0 comments on commit 5719a4f

Please sign in to comment.