OSDN Git Service

android: fix vulkan build issues with anv_entrypoints
authorTapani Pälli <tapani.palli@intel.com>
Thu, 23 Mar 2017 10:48:34 +0000 (12:48 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 23 Mar 2017 12:04:44 +0000 (14:04 +0200)
Patch fixes entrypoint generation for libmesa_anv_entrypoints that
still used old style of calling generator script.

Also small fixes to libmesa_vulkan_common where there was a typo
in target name (vulknan) and files were generated to wrong folder.

Fixes: 8211e3e6 ("anv: Generate anv_entrypoints header and code in one command")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
src/intel/Android.vulkan.mk

index 0649a2e..cc0b5df 100644 (file)
@@ -58,9 +58,10 @@ $(intermediates)/vulkan/dummy.c:
        @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))"
        $(hide) touch $@
 
-$(intermediates)/vulkan/anv_entrypoints.h:
-       $(VK_ENTRYPOINTS_SCRIPT) header $@ --xml $(MESA_TOP)/src/vulkan/registry/vk.xml
-
+$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/dummy.c
+       $(VK_ENTRYPOINTS_SCRIPT) \
+               --outdir $(dir $@) \
+               --xml $(MESA_TOP)/src/vulkan/registry/vk.xml
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
         $(intermediates)
@@ -177,13 +178,18 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
        libmesa_genxml \
        libmesa_vulkan_util
 
+# The rule generates both C and H files, but due to some strange
+# reason generating the files once leads to link-time issues.
+# Work around create them here as well - we're safe from race
+# conditions since they are stored in another location.
+
 LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_entrypoints.c
 
-$(intermediates)/vulknan/anv_entrypoints.c:
+$(intermediates)/vulkan/anv_entrypoints.c:
+       @mkdir -p $(dir $@)
        $(VK_ENTRYPOINTS_SCRIPT) \
                --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \
-               --outdir $(intermediates)/vulkan
-$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/anv_entrypoints.c
+               --outdir $(dir $@)
 
 LOCAL_SHARED_LIBRARIES := libdrm_intel