[vulkan] Respect the VULKAN_SDK environment variable

Thanks to Peter for the report and help in getting it working (I hope I
got all the changes right).
This commit is contained in:
Bill Currie 2023-03-25 18:39:46 +09:00
parent f098bbf48b
commit 86f2df4939
3 changed files with 14 additions and 4 deletions

View file

@ -26,7 +26,7 @@ NOCONV_DIST= \
BUILT_SOURCES = $(top_srcdir)/.version
#AM_CFLAGS= @PREFER_NON_PIC@
AM_CPPFLAGS= -I$(top_srcdir)/include $(PTHREAD_CFLAGS) $(FNM_FLAGS) $(NCURSES_CFLAGS) $(FREETYPE_CFLAGS) $(HARFBUZZ_CFLAGS)
AM_CPPFLAGS= -I$(top_srcdir)/include $(PTHREAD_CFLAGS) $(FNM_FLAGS) $(NCURSES_CFLAGS) $(FREETYPE_CFLAGS) $(HARFBUZZ_CFLAGS) $(VULKAN_CPPFLAGS)
common_ldflags= -export-dynamic @STATIC@ @PTHREAD_LDFLAGS@

View file

@ -9,13 +9,24 @@ if test "x$HAVE_VULKAN" != xno; then
LDFLAGS="$LDFLAGS -L$VULKAN_SDK/lib"
glslangvalidator="$VULKAN_SDK/bin/glslangValidator"
], [glslangvalidator="glslangValidator"])
AC_CHECK_HEADER([vulkan/vulkan.h], [HAVE_VULKAN=yes], [HAVE_VULKAN=no])
AC_CHECK_HEADER([vulkan/vulkan.h], [
HAVE_VULKAN=yes
AS_IF([test x"$VULKAN_SDK" != x], [
VULKAN_CPPFLAGS="-I$VULKAN_SDK/include"
VULKAN_QCFLAGS="-I$VULKAN_SDK/include"
VULKAN_LDFLAGS="-L$VULKAN_SDK/lib"
],[
VULKAN_QCFLAGS="-I/usr/include"
])
], [HAVE_VULKAN=no])
CPPFLAGS="$save_CPPFLAGS"
fi
if test "x$HAVE_VULKAN" = xyes; then
AC_DEFINE([HAVE_VULKAN], [1], [Define if yhou have the Vulkan libs])
fi
AC_SUBST(VULKAN_LIBS)
AC_SUBST(VULKAN_CPPFLAGS)
AC_SUBST(VULKAN_QCFLAGS)
AC_SUBST(GLSLANGVALIDATOR, [$glslangvalidator])
AM_CONDITIONAL(X11_VULKAN, test "x$HAVE_VULKAN" = "xyes")

View file

@ -25,8 +25,7 @@ vkgen_dat_src= \
libs/video/renderer/vulkan/vkgen/vktype.r \
libs/video/renderer/vulkan/vkgen/vulkan.r
VKGENUSRINC = /usr/include
VKGENFLAGS = -I$(top_srcdir)/libs/video/renderer/vulkan/vkgen -I$(VKGENUSRINC)
VKGENFLAGS = -I$(top_srcdir)/libs/video/renderer/vulkan/vkgen $(VULKAN_QCFLAGS)
vkgen_dat_SOURCES=$(vkgen_dat_src)
vkgen_obj=$(vkgen_dat_SOURCES:.r=.o)