Signed-off-by: Chip Davis cdavis@codeweavers.com ---
Notes: Try 2: Only enable demos if XCB is present.
Makefile.am | 4 ++++ configure.ac | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am index f696284..e5cacda 100644 --- a/Makefile.am +++ b/Makefile.am @@ -131,16 +131,20 @@ TESTS = $(vkd3d_tests) $(vkd3d_cross_tests) tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ tests_vkd3d_api_LDADD = libvkd3d.la @VULKAN_LIBS@
+if BUILD_DEMOS DEMOS_LDADD = $(LDADD) libvkd3d-shader.la @XCB_LIBS@ @VULKAN_LIBS@ DEMOS_CFLAGS = $(AM_CFLAGS) @XCB_CFLAGS@ noinst_PROGRAMS += $(vkd3d_demos) +endif EXTRA_DIST += $(vkd3d_test_headers) $(vkd3d_demos_headers)
+if BUILD_DEMOS demos_gears_CFLAGS = $(DEMOS_CFLAGS) demos_gears_LDADD = $(DEMOS_LDADD) -lm
demos_triangle_CFLAGS = $(DEMOS_CFLAGS) demos_triangle_LDADD = $(DEMOS_LDADD) +endif
VKD3D_V_WIDL = $(vkd3d_v_widl_@AM_V@) vkd3d_v_widl_ = $(vkd3d_v_widl_@AM_DEFAULT_V@) diff --git a/configure.ac b/configure.ac index 973105b..e4d0d24 100644 --- a/configure.ac +++ b/configure.ac @@ -85,7 +85,16 @@ AS_IF([test "x$with_spirv_tools" = "xyes"], [AC_DEFINE([HAVE_SPIRV_TOOLS], [1], [Define to 1 if you have SPIRV-Tools.]) HAVE_SPIRV_TOOLS=yes])])
-PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms]) +PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms], + [AC_DEFINE([HAVE_XCB], [1], [Define to 1 if you have libxcb.]) + HAVE_XCB=yes]) + +AS_IF([test "x$HAVE_XCB" = xyes], + [enable_demos_default=yes], + [enable_demos_default=no]) +AC_ARG_ENABLE([demos], AS_HELP_STRING([--enable-demos], [Build demo programs]),, + [enable_demos=$enable_demos_default]) +AM_CONDITIONAL(BUILD_DEMOS, [test "x$enable_demos" != "xno"])
dnl Check for functions VKD3D_CHECK_FUNC([HAVE_BUILTIN_CLZ], [__builtin_clz], [__builtin_clz(0)])