KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.27k stars 638 forks source link

Fails to build with libc++ and clang 18.x #912

Open kraj opened 8 months ago

kraj commented 8 months ago

When building with clang and using llvm c++ runtime ( libc++ ), the builds fail with

| In file included from /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/git/framework/platform/platform.cpp:18:
| In file included from /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/git/framework/platform/platform.h:21:
| In file included from /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/recipe-sysroot/usr/include/c++/v1/string:62
5:
| In file included from /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/recipe-sysroot/usr/include/c++/v1/string_vi
ew:213:
| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/recipe-sysroot/usr/include/c++/v1/__fwd/string_view.h:22:41: erro
r: 'char_traits<fmt::detail::char8_type>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t i
s non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Werror,-Wdeprecated-
declarations]
|    22 | template <class _CharT, class _Traits = char_traits<_CharT> >
|       |                                         ^
| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/git/third_party/fmt/include/fmt/core.h:357:26: note: in instantia
tion of default argument for 'basic_string_view<fmt::detail::char8_type>' required here
|   357 | template <typename Char> using std_string_view = std::basic_string_view<Char>;
|       |                          ^~~~~
| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/git/third_party/fmt/include/fmt/core.h:448:50: note: in instantia
tion of template type alias 'std_string_view' requested here
|   448 |                                       S, detail::std_string_view<Char>>::value)>
|       |                                                  ^
| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/git/third_party/fmt/include/fmt/format.h:781:57: note: in instant
iation of template class 'fmt::basic_string_view<fmt::detail::char8_type>' requested here
|   781 | inline auto compute_width(basic_string_view<char8_type> s) -> size_t {
|       |                                                         ^
| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/recipe-sysroot/usr/include/c++/v1/__string/char_traits.h:81:8: no
te: 'char_traits<fmt::detail::char8_type>' has been explicitly marked deprecated here
|    81 | struct _LIBCPP_DEPRECATED_(
|       |        ^
| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/vulkan-samples/git/recipe-sysroot/usr/include/c++/v1/__config:975:53: note: expanded
 from macro '_LIBCPP_DEPRECATED_'
|   975 | #      define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
|       |                                                     ^
| 1 error generated.

For now the workaround is to use -Wno-error=deprecated-declarations in cppflags but it will be a hard error starting llvm-19 so this needs to be fixed to not use char_traits

SaschaWillems commented 1 week ago

I can reproduce this while trying to update the Android builds tools. We'll look into this.

See #1188