Files
vkd3d/m4/check-cflags.m4
Henri Verbeet d4032f7d09 demos: Build with -fno-lto.
Some versions of Clang do not properly pass include paths to the
assembler when LTO is enabled. That's a problem for the DEMO_EMBED macro
used by the demos, since it relies on .incbin. To make matters even
better, compilation fails, but doesn't return an error code; the
resulting binary is simply broken. Fortunately we don't really care
about LTO for the demos, so we can simply disable it. See also
https://github.com/llvm/llvm-project/issues/112920

Thanks to Giovanni for tracking down some of the pieces of this issue.
2025-05-14 14:06:37 +02:00

17 lines
741 B
Plaintext

dnl
dnl This file contains code derived from WINE_TRY_CFLAGS() and is used courtesy of Alexandre Julliard.
dnl
dnl VKD3D_CHECK_CFLAGS(flags,[action-if-yes,[action-if-no]])
AC_DEFUN([VKD3D_CHECK_CFLAGS],
[AS_VAR_PUSHDEF([vkd3d_cflags], vkd3d_cv_cflags_[[$1]])dnl
AC_CACHE_CHECK([whether the compiler supports $1], vkd3d_cflags,
[vkd3d_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS $1 -Werror"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
[AS_VAR_SET(vkd3d_cflags, yes)],
[AS_VAR_SET(vkd3d_cflags, no)])
CFLAGS=$vkd3d_cflags_saved])
AS_VAR_IF([vkd3d_cflags], [yes], [m4_default([$2], [VKD3D_CFLAGS="$VKD3D_CFLAGS $1"])], [$3])dnl
AS_VAR_POPDEF([vkd3d_cflags])])