Android.mk: Generate the dummy source in local-generated-sources-dir

A source file cannot be otherwise referenced by absolute path.
That happens when OUT_DIR_COMMON_BASE is set.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16674>
This commit is contained in:
Alessandro Astone 2022-06-18 18:16:09 +02:00 committed by Marge Bot
parent b0a1a28d97
commit 5feb025086

View File

@ -32,15 +32,16 @@ MY_PATH := $(call my-dir)
AOSP_ABSOLUTE_PATH := $(realpath .)
m_dummy_$(LOCAL_MULTILIB) := $(TARGET_OUT_INTERMEDIATES)/MESON_DUMMY_$(LOCAL_MULTILIB)/dummy.c
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE := meson.dummy.$(LOCAL_MULTILIB)
$(m_dummy_$(LOCAL_MULTILIB)):
m_dummy := $(local-generated-sources-dir)/dummy.c
$(m_dummy):
mkdir -p $(dir $@)
touch $@
LOCAL_SRC_FILES := $(call relative_top_path,$(MY_PATH))$(m_dummy_$(LOCAL_MULTILIB))
LOCAL_GENERATED_SOURCES := $(m_dummy)
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE := meson.dummy.$(LOCAL_MULTILIB)
# Prepare intermediate variables by AOSP make/core internals
include $(BUILD_SHARED_LIBRARY)