meson: generate shader headers
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
2c273f32d3
commit
650b5d548e
19
Makefile
19
Makefile
@ -393,7 +393,6 @@ clean: recurse-clean ninja-clean clean-ctlist
|
||||
rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ */*~
|
||||
rm -f fsdev/*.pod scsi/*.pod
|
||||
rm -f qemu-img-cmds.h
|
||||
rm -f ui/shader/*-vert.h ui/shader/*-frag.h
|
||||
rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
|
||||
rm -f config-all-devices.mak
|
||||
rm -f $(SUBDIR_DEVICES_MAK)
|
||||
@ -618,24 +617,6 @@ endif
|
||||
$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
|
||||
done
|
||||
|
||||
# opengl shader programs
|
||||
ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
|
||||
@mkdir -p $(dir $@)
|
||||
$(call quiet-command,\
|
||||
perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
|
||||
"VERT","$@")
|
||||
|
||||
ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
|
||||
@mkdir -p $(dir $@)
|
||||
$(call quiet-command,\
|
||||
perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
|
||||
"FRAG","$@")
|
||||
|
||||
ui/shader.o: $(SRC_PATH)/ui/shader.c \
|
||||
ui/shader/texture-blit-vert.h \
|
||||
ui/shader/texture-blit-flip-vert.h \
|
||||
ui/shader/texture-blit-frag.h
|
||||
|
||||
# documentation
|
||||
MAKEINFO=makeinfo
|
||||
MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
|
||||
|
@ -159,6 +159,7 @@ have_block = have_system or have_tools
|
||||
# Generators
|
||||
|
||||
genh = []
|
||||
shaderinclude = find_program('scripts/shaderinclude.pl')
|
||||
qapi_gen = find_program('scripts/qapi-gen.py')
|
||||
qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
|
||||
meson.source_root() / 'scripts/qapi/commands.py',
|
||||
|
@ -32,3 +32,5 @@ if have_system
|
||||
'code-map', '@INPUT0@', e[0], e[1]])
|
||||
endforeach
|
||||
endif
|
||||
|
||||
subdir('shader')
|
||||
|
15
ui/shader/meson.build
Normal file
15
ui/shader/meson.build
Normal file
@ -0,0 +1,15 @@
|
||||
shaders = [
|
||||
['texture-blit', 'frag'],
|
||||
['texture-blit', 'vert'],
|
||||
['texture-blit-flip', 'vert'],
|
||||
]
|
||||
|
||||
foreach e : shaders
|
||||
output = '@0@-@1@.h'.format(e[0], e[1])
|
||||
genh += custom_target(output,
|
||||
output: output,
|
||||
capture: true,
|
||||
build_by_default: true, # to be removed when added to a target
|
||||
input: files('@0@.@1@'.format(e[0], e[1])),
|
||||
command: [shaderinclude, '@INPUT0@'])
|
||||
endforeach
|
Loading…
Reference in New Issue
Block a user