Android: glsl: add rules to generate ir_expression*.h header files
Recent changes to generate ir_expression*.h header files broke Android builds. This adds the generation rules. This change is complicated due to creating a circular dependency between libmesa_glsl, libmesa_nir, and libmesa_compiler. Normally, we add static libraries so that include paths are added even if there's no linking dependency. That is the case here. Instead, we explicitly add the include path using $(MESA_GEN_GLSL_H) to libmesa_compiler. This in turn requires shuffling the order of make includes. It also uncovered missing dependency tracking of glsl_parser.h. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:

committed by
Emil Velikov

parent
2593354643
commit
244f0aba16
@@ -41,6 +41,15 @@ LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
|
||||
$(LIBGLCPP_GENERATED_FILES) \
|
||||
$(LIBGLSL_GENERATED_FILES))
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS += \
|
||||
$(intermediates)/glsl \
|
||||
|
||||
# Modules using libmesa_nir must set LOCAL_GENERATED_SOURCES to this
|
||||
MESA_GEN_GLSL_H := $(addprefix $(call local-generated-sources-dir)/, \
|
||||
glsl/ir_expression_operation.h \
|
||||
glsl/ir_expression_operation_constant.h \
|
||||
glsl/ir_expression_operation_strings.h)
|
||||
|
||||
define local-l-or-ll-to-c-or-cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
|
||||
@@ -73,8 +82,24 @@ $(intermediates)/glsl/glsl_lexer.cpp: $(LOCAL_PATH)/glsl/glsl_lexer.ll
|
||||
$(intermediates)/glsl/glsl_parser.cpp: $(LOCAL_PATH)/glsl/glsl_parser.yy
|
||||
$(call local-yy-to-cpp-and-h,.cpp)
|
||||
|
||||
$(intermediates)/glsl/glsl_parser.h: $(intermediates)/glsl/glsl_parser.cpp
|
||||
|
||||
$(intermediates)/glsl/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glsl/glcpp/glcpp-lex.l
|
||||
$(call local-l-or-ll-to-c-or-cpp)
|
||||
|
||||
$(intermediates)/glsl/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glsl/glcpp/glcpp-parse.y
|
||||
$(call glsl_local-y-to-c-and-h)
|
||||
|
||||
$(LOCAL_PATH)/glsl/ir.h: $(intermediates)/glsl/ir_expression_operation.h
|
||||
|
||||
$(intermediates)/glsl/ir_expression_operation.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
|
||||
@mkdir -p $(dir $@)
|
||||
$(hide) $(MESA_PYTHON2) $< enum > $@
|
||||
|
||||
$(intermediates)/glsl/ir_expression_operation_constant.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
|
||||
@mkdir -p $(dir $@)
|
||||
$(hide) $(MESA_PYTHON2) $< constant > $@
|
||||
|
||||
$(intermediates)/glsl/ir_expression_operation_strings.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
|
||||
@mkdir -p $(dir $@)
|
||||
$(hide) $(MESA_PYTHON2) $< strings > $@
|
||||
|
Reference in New Issue
Block a user