contrib:wine-headers: remove unused D3D9 features
[vlc.git] / contrib / src / wine-headers / rules.mak
1 # WINE
2 WINE_VERSION := 4.5
3 WINE_URL := https://dl.winehq.org/wine/source/4.x/wine-$(WINE_VERSION).tar.xz
4
5 ifdef HAVE_WIN32
6 PKGS += wine-headers
7 endif
8
9 # Order is important since *_(n).idl will depends on *_(n-1).idl
10 WINE_EXTRA_HEADERS =
11 WINE_IDL_D3D9_HEADERS =
12 WINE_IDL_HEADERS = \
13         d3d11.idl \
14         d3d11_1.idl d3d11_2.idl d3d11_3.idl \
15         dxgicommon.idl dxgitype.idl dxgiformat.idl \
16         dxgidebug.idl \
17         dxgi.idl dxgi1_2.idl dxgi1_3.idl dxgi1_4.idl dxgi1_5.idl dxgi1_6.idl
18
19 ifndef HAVE_VISUALSTUDIO
20 WINE_EXTRA_HEADERS += d3d9caps.h d3d9.h
21 WINE_IDL_D3D9_HEADERS += dxva2api.idl
22 endif
23
24 $(TARBALLS)/wine-$(WINE_VERSION).tar.xz:
25         $(call download_pkg,$(WINE_URL),wine)
26
27 .sum-wine-headers: wine-$(WINE_VERSION).tar.xz
28
29 wine-headers: wine-$(WINE_VERSION).tar.xz .sum-wine-headers
30         $(UNPACK)
31         $(APPLY) $(SRC)/wine-headers/dxva2api.patch
32         $(APPLY) $(SRC)/wine-headers/dxgidebug.patch
33         $(APPLY) $(SRC)/wine-headers/processor_format.patch
34         $(MOVE)
35
36 wine_widl = echo "GEN $(1)" && \
37         $(WIDL) -DBOOL=WINBOOL $(3) \
38         -I$(PREFIX)/include -Iwine-headers/idl-include \
39         -I`echo $(MSYSTEM) | tr A-Z a-z`/$(BUILD)/include -h \
40         -o "$(PREFIX)/include/$(1)" "wine-headers/idl-include/$(2)"
41
42 .wine-headers: wine-headers
43         @mkdir -p $(PREFIX)/include
44         @mkdir -p wine-headers/idl-include
45         @cp wine-headers/include/*.idl  wine-headers/idl-include # be sure to not use .h from the wine project
46         @for header in $(WINE_IDL_HEADERS); do \
47                 $(call wine_widl,"`basename $$header idl`h",$$header,); \
48         done
49         @for header in $(WINE_IDL_D3D9_HEADERS); do \
50                 $(call wine_widl,"`basename $$header idl`h",$$header,-D_D3D9_H_ -D__C89_NAMELESS); \
51         done
52         @for header in $(WINE_EXTRA_HEADERS); do \
53                 echo "CP  $$header"; \
54                 cp "wine-headers/include/$$header" "$(PREFIX)/include"; \
55         done
56         touch $@