android: virgl: fix generated virgl_driinfo.h building rules

Submitted by Mauro Rossi on June 21, 2019, 6:06 p.m.

Details

Message ID 20190621180620.10606-1-issor.oruam@gmail.com
State New
Headers show
Series "android: virgl: fix generated virgl_driinfo.h building rules" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Mauro Rossi June 21, 2019, 6:06 p.m.
Changelog in Android makefile:
- Add LOCAL_MODULE_CLASS, intermediates and LOCAL_GENERATED_SOURCES
- Use LOCAL_EXPORT_C_INCLUDE_DIRS to export $(intermediates) path
- Move generated header rules before 'include $(BUILD_STATIC_LIBRARY)'

Fixes the following building error:

In file included from external/mesa/src/gallium/targets/dri/target.c:1:
external/mesa/src/gallium/auxiliary/target-helpers/drm_helper.h:257:16:
fatal error: 'virgl/virgl_driinfo.h' file not found
      #include "virgl/virgl_driinfo.h"
               ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: cf800998a ("virgl: Add driinfo file and tie it into the build")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
---
 src/gallium/drivers/virgl/Android.mk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/virgl/Android.mk b/src/gallium/drivers/virgl/Android.mk
index f77bcf196e..585ed7b2ce 100644
--- a/src/gallium/drivers/virgl/Android.mk
+++ b/src/gallium/drivers/virgl/Android.mk
@@ -30,8 +30,9 @@  LOCAL_SRC_FILES := \
 
 LOCAL_MODULE := libmesa_pipe_virgl
 
-include $(GALLIUM_COMMON_MK)
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+intermediates := $(call local-generated-sources-dir)
+LOCAL_GENERATED_SOURCES += $(intermediates)/virgl/virgl_driinfo.h
 
 GEN_DRIINFO_INPUTS := \
 	$(MESA_TOP)/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h \
@@ -44,6 +45,11 @@  $(intermediates)/virgl/virgl_driinfo.h: $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
 	@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
 	$(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || ($(RM) $@; false)
 
+LOCAL_EXPORT_C_INCLUDE_DIRS += $(intermediates)
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
 ifneq ($(HAVE_GALLIUM_VIRGL),)
 GALLIUM_TARGET_DRIVERS += virtio_gpu
 $(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common libmesa_winsys_virgl libmesa_winsys_virgl_vtest)

Comments

Mauro Rossi <issor.oruam@gmail.com> 於 2019年6月22日 週六 上午2:06寫道:
>
> Changelog in Android makefile:
> - Add LOCAL_MODULE_CLASS, intermediates and LOCAL_GENERATED_SOURCES
> - Use LOCAL_EXPORT_C_INCLUDE_DIRS to export $(intermediates) path
> - Move generated header rules before 'include $(BUILD_STATIC_LIBRARY)'
>
> Fixes the following building error:
>
> In file included from external/mesa/src/gallium/targets/dri/target.c:1:
> external/mesa/src/gallium/auxiliary/target-helpers/drm_helper.h:257:16:
> fatal error: 'virgl/virgl_driinfo.h' file not found
>       #include "virgl/virgl_driinfo.h"
>                ^~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
>
> Fixes: cf800998a ("virgl: Add driinfo file and tie it into the build")
> Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
> ---
>  src/gallium/drivers/virgl/Android.mk | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/virgl/Android.mk b/src/gallium/drivers/virgl/Android.mk
> index f77bcf196e..585ed7b2ce 100644
> --- a/src/gallium/drivers/virgl/Android.mk
> +++ b/src/gallium/drivers/virgl/Android.mk
> @@ -30,8 +30,9 @@ LOCAL_SRC_FILES := \
>
>  LOCAL_MODULE := libmesa_pipe_virgl
>
> -include $(GALLIUM_COMMON_MK)
> -include $(BUILD_STATIC_LIBRARY)
> +LOCAL_MODULE_CLASS := STATIC_LIBRARIES
> +intermediates := $(call local-generated-sources-dir)
> +LOCAL_GENERATED_SOURCES += $(intermediates)/virgl/virgl_driinfo.h
>
>  GEN_DRIINFO_INPUTS := \
>         $(MESA_TOP)/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h \
> @@ -44,6 +45,11 @@ $(intermediates)/virgl/virgl_driinfo.h: $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
>         @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
>         $(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || ($(RM) $@; false)
>
> +LOCAL_EXPORT_C_INCLUDE_DIRS += $(intermediates)
> +
> +include $(GALLIUM_COMMON_MK)
> +include $(BUILD_STATIC_LIBRARY)
> +
>  ifneq ($(HAVE_GALLIUM_VIRGL),)
>  GALLIUM_TARGET_DRIVERS += virtio_gpu
>  $(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl_common libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
> --

I suggest to use := instead of += in
LOCAL_GENERATED_SOURCES and LOCAL_EXPORT_C_INCLUDE_DIRS
since they don't catenate others.
Except that, the patch looks good to me.

Review-by: Chih-Wei Huang <cwhuang@linux.org.tw>