android: panfrost: Redirect cmdstream includes through GenXML
authorMauro Rossi <issor.oruam@gmail.com>
Fri, 14 Aug 2020 02:11:36 +0000 (04:11 +0200)
committerMauro Rossi <issor.oruam@gmail.com>
Fri, 14 Aug 2020 13:19:31 +0000 (15:19 +0200)
Fixes the following building error:

external/mesa/src/panfrost/lib/decode.c:26:10: fatal error: 'midgard_pack.h' file not found
         ^~~~~~~~~~~~~~~~
1 error generated.

Fixes: 88dc4c21e ("panfrost: Redirect cmdstream includes through GenXML")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6317>

src/panfrost/Android.lib.mk

index cda70388607f4ca85d8301138303dbd6a016764a..ab5d2126a8550b4749ecd4906b086066d838dcbc 100644 (file)
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libpanfrost_lib
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+intermediates := $(call local-generated-sources-dir)
 
 LOCAL_SRC_FILES := \
        $(lib_FILES)
 
+LOCAL_GENERATED_SOURCES := \
+       $(intermediates)/panfrost/lib/midgard_pack.h
+
 LOCAL_C_INCLUDES := \
        $(MESA_TOP)/src/gallium/auxiliary/ \
        $(MESA_TOP)/src/gallium/include/ \
        $(MESA_TOP)/src/panfrost/lib/ \
-       $(MESA_TOP)/src/panfrost/include/
+       $(MESA_TOP)/src/panfrost/include/ \
+       $(intermediates)/panfrost/lib/
 
 LOCAL_STATIC_LIBRARIES := \
        libmesa_nir
 
-LOCAL_GENERATED_SOURCES := \
+midgard_pack_gen := $(LOCAL_PATH)/lib/gen_pack.py
+midgard_pack_deps := $(LOCAL_PATH)/lib/midgard.xml
+
+$(intermediates)/panfrost/lib/midgard_pack.h: $(midgard_pack_deps)
+       @mkdir -p $(dir $@)
+       $(hide) $(MESA_PYTHON2) $(midgard_pack_gen) $< > $@
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
        $(MESA_TOP)/src/panfrost/lib/ \
+       $(intermediates)
 
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)