From 5cb61f27d0b9e34c149775483873cfbdb4db8774 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Thu, 20 Jun 2019 18:13:36 +0800 Subject: [PATCH] android: anv: eliminate libmesa_anv_entrypoints The dummy library libmesa_anv_entrypoints is totally unnecessary. The four VULKAN_GENERATED_FILES could be generated and built in libmesa_vulkan_common directly. The libraries using the generated headers should get it via the exported include path. Signed-off-by: Chih-Wei Huang Acked-by: Eric Engestrom Acked-by: Emil Velikov --- src/intel/Android.vulkan.mk | 82 +++++++++---------------------------- 1 file changed, 20 insertions(+), 62 deletions(-) diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk index 5083fec3fd6..450cf2efdda 100644 --- a/src/intel/Android.vulkan.mk +++ b/src/intel/Android.vulkan.mk @@ -53,60 +53,9 @@ VULKAN_COMMON_HEADER_LIBRARIES := \ libhardware_headers endif -# libmesa_anv_entrypoints with header and dummy.c -# -# This static library is built to pull entrypoints header -# for multiple gen specific build targets below. The c file -# is generated separately for libmesa_vulkan_common to avoid -# duplicate symbols when linking the anv libraries. - -include $(CLEAR_VARS) -LOCAL_MODULE := libmesa_anv_entrypoints -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -intermediates := $(call local-generated-sources-dir) - -LOCAL_C_INCLUDES := \ - $(VULKAN_COMMON_INCLUDES) - -LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_entrypoints.h -LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/dummy.c -LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.h - -$(intermediates)/vulkan/dummy.c: - @mkdir -p $(dir $@) - @echo "Gen Dummy: $(PRIVATE_MODULE) <= $(notdir $(@))" - $(hide) touch $@ - -$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/dummy.c \ - $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ - $(ANV_EXTENSIONS_SCRIPT) \ - $(VULKAN_API_XML) - $(MESA_PYTHON2) $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ - --outdir $(dir $@) \ - --xml $(VULKAN_API_XML) - -$(intermediates)/vulkan/anv_extensions.h: $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ - $(ANV_EXTENSIONS_SCRIPT) \ - $(VULKAN_API_XML) - @mkdir -p $(dir $@) - $(MESA_PYTHON2) $(ANV_EXTENSIONS_GEN_SCRIPT) \ - --xml $(VULKAN_API_XML) \ - --out-h $@ - -LOCAL_EXPORT_C_INCLUDE_DIRS := \ - $(intermediates) - -LOCAL_SHARED_LIBRARIES := libdrm - -include $(MESA_COMMON_MK) -include $(BUILD_STATIC_LIBRARY) - ANV_INCLUDES := \ $(VULKAN_COMMON_INCLUDES) \ - $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_anv_entrypoints,,)/vulkan \ $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \ - $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_common,,)/vulkan \ ANV_SHARED_LIBRARIES := libdrm @@ -127,7 +76,7 @@ LOCAL_CFLAGS := -DGEN_VERSIONx10=70 LOCAL_C_INCLUDES := $(ANV_INCLUDES) -LOCAL_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml +LOCAL_STATIC_LIBRARIES := libmesa_vulkan_common libmesa_genxml LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -148,7 +97,7 @@ LOCAL_CFLAGS := -DGEN_VERSIONx10=75 LOCAL_C_INCLUDES := $(ANV_INCLUDES) -LOCAL_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml +LOCAL_STATIC_LIBRARIES := libmesa_vulkan_common libmesa_genxml LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -169,7 +118,7 @@ LOCAL_CFLAGS := -DGEN_VERSIONx10=80 LOCAL_C_INCLUDES := $(ANV_INCLUDES) -LOCAL_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml +LOCAL_STATIC_LIBRARIES := libmesa_vulkan_common libmesa_genxml LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -190,7 +139,7 @@ LOCAL_CFLAGS := -DGEN_VERSIONx10=90 LOCAL_C_INCLUDES := $(ANV_INCLUDES) -LOCAL_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml +LOCAL_STATIC_LIBRARIES := libmesa_vulkan_common libmesa_genxml LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -211,7 +160,7 @@ LOCAL_CFLAGS := -DGEN_VERSIONx10=100 LOCAL_C_INCLUDES := $(ANV_INCLUDES) -LOCAL_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml +LOCAL_STATIC_LIBRARIES := libmesa_vulkan_common libmesa_genxml LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -232,7 +181,7 @@ LOCAL_CFLAGS := -DGEN_VERSIONx10=110 LOCAL_C_INCLUDES := $(ANV_INCLUDES) -LOCAL_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml +LOCAL_STATIC_LIBRARIES := libmesa_vulkan_common libmesa_genxml LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -252,12 +201,14 @@ intermediates := $(call local-generated-sources-dir) LOCAL_SRC_FILES := $(VULKAN_FILES) +LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)/vulkan + LOCAL_C_INCLUDES := \ + $(LOCAL_EXPORT_C_INCLUDE_DIRS) \ $(ANV_INCLUDES) \ $(MESA_TOP)/src/compiler LOCAL_STATIC_LIBRARIES := \ - libmesa_anv_entrypoints \ libmesa_genxml \ libmesa_git_sha1 \ libmesa_vulkan_util @@ -267,8 +218,7 @@ LOCAL_STATIC_LIBRARIES := \ # 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 -LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.c +LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(VULKAN_GENERATED_FILES)) $(intermediates)/vulkan/anv_entrypoints.c: $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ $(ANV_EXTENSIONS_SCRIPT) \ @@ -278,6 +228,8 @@ $(intermediates)/vulkan/anv_entrypoints.c: $(ANV_ENTRYPOINTS_GEN_SCRIPT) \ --xml $(VULKAN_API_XML) \ --outdir $(dir $@) +$(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/anv_entrypoints.c + $(intermediates)/vulkan/anv_extensions.c: $(ANV_EXTENSIONS_GEN_SCRIPT) \ $(ANV_EXTENSIONS_SCRIPT) \ $(VULKAN_API_XML) @@ -286,6 +238,14 @@ $(intermediates)/vulkan/anv_extensions.c: $(ANV_EXTENSIONS_GEN_SCRIPT) \ --xml $(VULKAN_API_XML) \ --out-c $@ +$(intermediates)/vulkan/anv_extensions.h: $(ANV_EXTENSIONS_GEN_SCRIPT) \ + $(ANV_EXTENSIONS_SCRIPT) \ + $(VULKAN_API_XML) + @mkdir -p $(dir $@) + $(MESA_PYTHON2) $(ANV_EXTENSIONS_GEN_SCRIPT) \ + --xml $(VULKAN_API_XML) \ + --out-h $@ + LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES) LOCAL_HEADER_LIBRARIES += $(VULKAN_COMMON_HEADER_LIBRARIES) @@ -312,8 +272,6 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ $(VULKAN_COMMON_INCLUDES) \ - $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_anv_entrypoints,,)/vulkan \ - $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_common,,)/vulkan LOCAL_WHOLE_STATIC_LIBRARIES := \ libmesa_nir \ -- 2.30.2