[vlc-devel] [PATCH 2/2] contribs: d3d: use the mingw headers found in pthread

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 4 14:23:53 CEST 2018


This way no need to install them on the build system.
We also get less varying environment between builds (the headers are updated
very often).
---
 contrib/src/d3d11/rules.mak | 25 +++++++++++--------------
 contrib/src/d3d9/rules.mak  | 13 +++++--------
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/contrib/src/d3d11/rules.mak b/contrib/src/d3d11/rules.mak
index 2a05543cd45..5f4f25b82a1 100644
--- a/contrib/src/d3d11/rules.mak
+++ b/contrib/src/d3d11/rules.mak
@@ -1,12 +1,5 @@
 # generate Direct3D11 temporary include
 
-ifdef HAVE_CROSS_COMPILE
-IDL_INC_PATH = /usr/include/wine/windows/
-else
-#ugly way to get the default location of standard idl files
-IDL_INC_PATH = /`echo $(MSYSTEM) | tr A-Z a-z`/$(BUILD)/include
-endif
-
 D3D11_COMMIT_ID := a0cd5afeb60be3be0860e9a203314c10485bb9b8
 DXGI12_COMMIT_ID := 790a6544347b53c314b9c6f1ea757a2d5504c67e
 DXGITYPE_COMMIT_ID := f4aba520d014ecfe3563e33860de001caf2804e2
@@ -30,6 +23,10 @@ DST_DXGI16_H = $(PREFIX)/include/dxgi1_6.h
 ifdef HAVE_WIN32
 PKGS += d3d11
 endif
+DEPS_d3d11 = pthreads $(DEPS_pthreads)
+
+#ugly way to get the default location of standard idl files
+D3D11_IDL_INC_PATH = -Ipthreads/mingw-w64-headers/include -Ipthreads/mingw-w64-headers/crt -Ipthreads/mingw-w64-headers/direct-x/include
 
 $(TARBALLS)/d3d11.idl:
 	$(call download_pkg,$(D3D11_IDL_URL),d3d11)
@@ -61,11 +58,11 @@ dxgi12: .sum-d3d11
 
 $(DST_D3D11_H): d3d11
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $</d3d11.idl
+	$(WIDL) -DBOOL=WINBOOL -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $</d3d11.idl
 
 $(DST_DXGIDEBUG_H): $(TARBALLS)/dxgidebug.idl
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $<
+	$(WIDL) -DBOOL=WINBOOL -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $<
 
 $(DST_DXGITYPE_H): $(TARBALLS)/dxgitype.h
 	mkdir -p -- "$(PREFIX)/include/"
@@ -81,23 +78,23 @@ $(DST_DXGI_IDL): $(TARBALLS)/dxgi.idl
 
 $(DST_DXGI12_H): dxgi12
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $</dxgi1_2.idl
+	$(WIDL) -DBOOL=WINBOOL -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $</dxgi1_2.idl
 
 $(DST_DXGI13_H): $(SRC)/d3d11/dxgi1_3.idl $(DST_DXGI12_H)
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $<
+	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $<
 
 $(DST_DXGI14_H): $(SRC)/d3d11/dxgi1_4.idl $(DST_DXGI13_H)
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $<
+	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $<
 
 $(DST_DXGI15_H): $(SRC)/d3d11/dxgi1_5.idl $(DST_DXGI14_H)
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $<
+	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $<
 
 $(DST_DXGI16_H): $(SRC)/d3d11/dxgi1_6.idl $(DST_DXGI15_H)
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include -I$(IDL_INC_PATH) -h -o $@ $<
+	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(PREFIX)/include $(D3D11_IDL_INC_PATH) -h -o $@ $<
 
 .dxgitype: $(DST_DXGITYPE_H) $(DST_DXGIFORMAT_H) $(DST_DXGI_IDL)
 	touch $@
diff --git a/contrib/src/d3d9/rules.mak b/contrib/src/d3d9/rules.mak
index 29ce9a33c1f..bfa30006219 100644
--- a/contrib/src/d3d9/rules.mak
+++ b/contrib/src/d3d9/rules.mak
@@ -1,12 +1,5 @@
 # generate Direct3D9 temporary include
 
-ifdef HAVE_CROSS_COMPILE
-IDL_INC_PATH = /usr/include/wine/windows/
-else
-#ugly way to get the default location of standard idl files
-IDL_INC_PATH = /`echo $(MSYSTEM) | tr A-Z a-z`/$(BUILD)/include
-endif
-
 D3D9CAPS_COMMIT_ID := 477108e5706e73421634436c21cb76e1795b3609
 DXVA2API_COMMIT_ID := 67bb96f54d720ca9e5aaa5da7d385348e0bfac31
 D3D9CAPS_H_URL := http://sourceforge.net/p/mingw-w64/mingw-w64/ci/$(D3D9CAPS_COMMIT_ID)/tree/mingw-w64-headers/direct-x/include/d3d9caps.h?format=raw
@@ -22,6 +15,10 @@ ifndef HAVE_VISUALSTUDIO
 PKGS += d3d9
 endif
 endif
+DEPS_d3d9 = pthreads $(DEPS_pthreads)
+
+#ugly way to get the default location of standard idl files
+D3D9_IDL_INC_PATH = -Ipthreads/mingw-w64-headers/include -Ipthreads/mingw-w64-headers/crt -Ipthreads/mingw-w64-headers/direct-x/include
 
 $(TARBALLS)/d3d9caps.h:
 	$(call download_pkg,$(D3D9CAPS_H_URL),d3d9)
@@ -49,7 +46,7 @@ dxva2api/dxva2api.idl: .sum-d3d9
 
 $(DST_DXVA2API_H): dxva2api/dxva2api.idl
 	mkdir -p -- "$(PREFIX)/include/"
-	$(WIDL) -DBOOL=WINBOOL -D_D3D9_H_ -D__C89_NAMELESS -I$(IDL_INC_PATH) -h -o $@ $<
+	$(WIDL) -DBOOL=WINBOOL -D_D3D9_H_ -D__C89_NAMELESS $(D3D9_IDL_INC_PATH) -h -o $@ $<
 
 .d3d9caps: $(DST_D3D9CAPS_H)
 	touch $@
-- 
2.19.0



More information about the vlc-devel mailing list