genvif: Prevent undefined referencer when using APIs not provided by genvif

Problem was detected while using ccprintf to debug a data role swap
requests issue. To prevent errors similar to this, surround the API call
as follows:

ifndef VIF_BUILD
ccprints("I won't generate an undefined reference when building genvif");
endif

BUG=b:63664511
BRANCH=None
TEST=`make -j buildall`

Change-Id: Ieab9eaa638320cae67995a67c843d08b54acfbcb
Signed-off-by: Sam Hurst <shurst@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/570820
Commit-Ready: Sam Hurst <shurst@google.com>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Sam Hurst
2017-07-13 11:47:19 -07:00
committed by chrome-bot
parent 98a1d2f9c7
commit cb7e26c993

View File

@@ -31,7 +31,8 @@ $(out)/util/genvif: $(out)/util/usb_pd_policy.o board/$(BOARD)/board.h \
include/usb_pd.h include/usb_pd_tcpm.h
$(out)/util/genvif: BUILD_LDFLAGS+=$(out)/util/usb_pd_policy.o -flto
STANDALONE_FLAGS=-ffreestanding -fno-builtin -nostdinc -Ibuiltin/ -D"__keep= "
STANDALONE_FLAGS=-ffreestanding -fno-builtin -nostdinc \
-Ibuiltin/ -D"__keep= " -DVIF_BUILD
$(out)/util/usb_pd_policy.o: board/$(BOARD)/usb_pd_policy.c
$(call quiet,c_to_vif,BUILDCC)
deps += $(out)/util/usb_pd_policy.o.d