mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
build: Add "crosstest" target for tests cross-compilation.
This commit is contained in:
parent
978584a238
commit
6bebee9a09
47
Makefile.am
47
Makefile.am
@ -44,3 +44,50 @@ libvkd3d.pc: $(srcdir)/libs/vkd3d/libvkd3d.pc.in
|
||||
-e 's![@]libdir[@]!$(libdir)!g' \
|
||||
-e 's![@]PACKAGE_VERSION[@]!$(PACKAGE_VERSION)!g' \
|
||||
$< > $@
|
||||
|
||||
## Cross-compile tests
|
||||
cross_implibs = crosslibs/d3d12
|
||||
CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include
|
||||
|
||||
if HAS_CROSSTARGET32
|
||||
CROSS32_CC = @CROSSCC32@
|
||||
CROSS32_DLLTOOL = @CROSSTARGET32@-dlltool
|
||||
CROSS32_IMPLIBS = $(cross_implibs:=.cross32.a)
|
||||
CROSS32_EXEFILES = $(vkd3d_tests:=.cross32.exe)
|
||||
CROSS32_FILES = $(CROSS32_IMPLIBS) $(CROSS32_EXEFILES)
|
||||
|
||||
CLEANFILES += $(CROSS32_FILES)
|
||||
crosstest32: $(widl_headers) $(CROSS32_FILES)
|
||||
|
||||
$(CROSS32_IMPLIBS): %.cross32.a: %.cross32.def
|
||||
${MKDIR_P} crosslibs
|
||||
$(CROSS32_DLLTOOL) -k -m i386 --as-flags=-32 -d $< -l $@
|
||||
|
||||
$(CROSS32_EXEFILES): %.cross32.exe: %.c $(CROSS32_IMPLIBS)
|
||||
$(CROSS32_CC) $(CROSS_CPPFLAGS) -o $@ $< $(CROSS32_IMPLIBS)
|
||||
else
|
||||
crosstest32:
|
||||
endif
|
||||
|
||||
if HAS_CROSSTARGET64
|
||||
CROSS64_CC = @CROSSCC64@
|
||||
CROSS64_DLLTOOL = @CROSSTARGET64@-dlltool
|
||||
CROSS64_IMPLIBS = $(cross_implibs:=.cross64.a)
|
||||
CROSS64_EXEFILES = $(vkd3d_tests:=.cross64.exe)
|
||||
CROSS64_FILES = $(CROSS64_IMPLIBS) $(CROSS64_EXEFILES)
|
||||
|
||||
CLEANFILES += $(CROSS64_FILES)
|
||||
crosstest64: $(widl_headers) $(CROSS64_FILES)
|
||||
|
||||
$(CROSS64_IMPLIBS): %.cross64.a: %.cross64.def
|
||||
${MKDIR_P} crosslibs
|
||||
$(CROSS64_DLLTOOL) -k -m i386:x86-64 --as-flags=-64 -d $< -l $@
|
||||
|
||||
$(CROSS64_EXEFILES): %.cross64.exe: %.c $(CROSS64_IMPLIBS)
|
||||
$(CROSS64_CC) $(CROSS_CPPFLAGS) -o $@ $< $(CROSS64_IMPLIBS)
|
||||
else
|
||||
crosstest64:
|
||||
endif
|
||||
|
||||
.PHONY: crosstest crosstest32 crosstest64
|
||||
crosstest: crosstest32 crosstest64
|
||||
|
@ -58,6 +58,13 @@ AC_LINK_IFELSE(
|
||||
AC_DEFINE([HAVE_SYNC_SUB_AND_FETCH], [1], [Define to 1 if you have __sync_sub_and_fetch.])],
|
||||
[AC_MSG_RESULT([no])])
|
||||
|
||||
dnl Check for cross compilers
|
||||
VKD3D_CHECK_MINGW32_PROG(CROSSCC32, CROSSTARGET32, false)
|
||||
VKD3D_CHECK_MINGW64_PROG(CROSSCC64, CROSSTARGET64, false)
|
||||
|
||||
AM_CONDITIONAL([HAS_CROSSTARGET32], [test "x$CROSSTARGET32" != xfalse])
|
||||
AM_CONDITIONAL([HAS_CROSSTARGET64], [test "x$CROSSTARGET64" != xfalse])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
|
7
crosslibs/d3d12.cross32.def
Normal file
7
crosslibs/d3d12.cross32.def
Normal file
@ -0,0 +1,7 @@
|
||||
LIBRARY D3D12.dll
|
||||
|
||||
EXPORTS
|
||||
D3D12CreateDevice@16 @101
|
||||
D3D12GetDebugInterface@8 @102
|
||||
D3D12CreateRootSignatureDeserializer@16 @106
|
||||
D3D12SerializeRootSignature@16 @107
|
7
crosslibs/d3d12.cross64.def
Normal file
7
crosslibs/d3d12.cross64.def
Normal file
@ -0,0 +1,7 @@
|
||||
LIBRARY D3D12.dll
|
||||
|
||||
EXPORTS
|
||||
D3D12CreateDevice @101
|
||||
D3D12GetDebugInterface @102
|
||||
D3D12CreateRootSignatureDeserializer @106
|
||||
D3D12SerializeRootSignature @107
|
@ -182,7 +182,15 @@ typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
|
||||
# define IsEqualGUID(guid1, guid2) (!memcmp(guid1, guid2, sizeof(GUID)))
|
||||
#endif
|
||||
|
||||
#elif !defined(__WIDL__)
|
||||
|
||||
# include <windows.h>
|
||||
|
||||
# ifndef __C89_NAMELESS
|
||||
# define __C89_NAMELESS
|
||||
# define __C89_NAMELESSUNIONNAME
|
||||
# endif /* __C89_NAMELESS */
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
#endif /* __VKD3D_WINDOWS_H */
|
||||
|
56
m4/check-mingw-prog.m4
Normal file
56
m4/check-mingw-prog.m4
Normal file
@ -0,0 +1,56 @@
|
||||
dnl VKD3D_CHECK_MINGW32_PROG(variable, crosstarget-variable, [value-if-not-found], [path])
|
||||
AC_DEFUN([VKD3D_CHECK_MINGW32_PROG],
|
||||
[
|
||||
AC_SUBST([$2], [$3])dnl
|
||||
ac_prefix_list="m4_foreach([ac_vkd3d_prefix], [w64-mingw32, pc-mingw32, mingw32msvc, mingw32],
|
||||
m4_foreach([ac_vkd3d_cpu], [i686, i586, i486, i386], [ac_vkd3d_cpu-ac_vkd3d_prefix-gcc ]))
|
||||
mingw32-gcc"
|
||||
AC_CHECK_PROGS([$1], [$ac_prefix_list], [$3], [$4])
|
||||
if test "x[$]$1" != x$3
|
||||
then
|
||||
ac_vkd3d_save_CC="$CC"
|
||||
CC="[$]$1"
|
||||
AC_MSG_CHECKING([whether $CC works])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
set x [$]$1
|
||||
shift
|
||||
while test "[$]#" -ge 1
|
||||
do
|
||||
case "[$]1" in
|
||||
*-gcc) $2=`expr "[$]1" : '\(.*\)-gcc'` ;;
|
||||
esac
|
||||
shift
|
||||
done],
|
||||
[AC_MSG_RESULT([no])])
|
||||
CC="$ac_vkd3d_save_CC"
|
||||
fi
|
||||
])
|
||||
|
||||
dnl VKD3D_CHECK_MINGW64_PROG(variable, crosstarget-variable, [value-if-not-found], [path])
|
||||
AC_DEFUN([VKD3D_CHECK_MINGW64_PROG],
|
||||
[
|
||||
AC_SUBST([$2], [$3])dnl
|
||||
ac_prefix_list="m4_foreach([ac_vkd3d_prefix], [pc-mingw32, w64-mingw32, mingw32msvc],
|
||||
m4_foreach([ac_vkd3d_cpu], [x86_64, amd64], [ac_vkd3d_cpu-ac_vkd3d_prefix-gcc ]))"
|
||||
AC_CHECK_PROGS([$1], [$ac_prefix_list], [$3], [$4])
|
||||
if test "x[$]$1" != x$3
|
||||
then
|
||||
ac_vkd3d_save_CC="$CC"
|
||||
CC="[$]$1"
|
||||
AC_MSG_CHECKING([whether $CC works])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
set x [$]$1
|
||||
shift
|
||||
while test "[$]#" -ge 1
|
||||
do
|
||||
case "[$]1" in
|
||||
*-gcc) $2=`expr "[$]1" : '\(.*\)-gcc'` ;;
|
||||
esac
|
||||
shift
|
||||
done],
|
||||
[AC_MSG_RESULT([no])])
|
||||
CC="$ac_vkd3d_save_CC"
|
||||
fi
|
||||
])
|
@ -20,9 +20,6 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define INITGUID
|
||||
#include "vkd3d_test.h"
|
||||
#include "vkd3d_windows.h"
|
||||
|
||||
/* Hack for MinGW-w64 headers.
|
||||
*
|
||||
@ -34,14 +31,21 @@
|
||||
* specifiers" compiler error.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#include <_mingw.h>
|
||||
# include <_mingw.h>
|
||||
# ifdef __MINGW64_VERSION_MAJOR
|
||||
# undef __forceinline
|
||||
# define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
# endif
|
||||
|
||||
# define _HRESULT_DEFINED
|
||||
typedef int HRESULT;
|
||||
#endif
|
||||
|
||||
#define INITGUID
|
||||
#define COBJMACROS
|
||||
#include "vkd3d_test.h"
|
||||
#include "vkd3d_windows.h"
|
||||
|
||||
#define WIDL_C_INLINE_WRAPPERS
|
||||
#include "d3d12.h"
|
||||
|
||||
@ -88,7 +92,7 @@ static void test_create_device(void)
|
||||
check_interface(device, &IID_ID3D12Device, TRUE);
|
||||
|
||||
refcount = ID3D12Device_Release(device);
|
||||
ok(!refcount, "ID3D12Device has %u references left.\n", refcount);
|
||||
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
|
||||
|
||||
hr = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&device);
|
||||
ok(hr == S_OK, "D3D12CreateDevice failed, hr %#x.\n", hr);
|
||||
|
Loading…
Reference in New Issue
Block a user