quotient-im / Quaternion

A Qt-based IM client for Matrix
https://matrix.org/ecosystem/clients/quaternion/
GNU General Public License v3.0
646 stars 108 forks source link

Quaternion fails to compile with -DCMAKE_DISABLE_PRECOMPILE_HEADERS=YES #918

Open 2xsaiko opened 13 hours ago

2xsaiko commented 13 hours ago

Description

Compiling Quaternion with -DCMAKE_DISABLE_PRECOMPILE_HEADERS=YES makes it fail to compile:

In file included from /Users/saiko/Src/tmp/Quaternion/client/networkconfigdialog.cpp:7:
In file included from /Users/saiko/Src/tmp/Quaternion/client/networkconfigdialog.h:9:
In file included from /Users/saiko/Src/tmp/Quaternion/client/dialog.h:9:
In file included from /usr/include/qt6/QtCore/QFlags:1:
In file included from /usr/include/qt6/QtCore/qflags.h:7:
/usr/include/qt6/QtCore/qcompare_impl.h:26:49: error: no member named 'is_null_pointer_v' in namespace 'std'
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                                            ~~~~~^
/usr/include/qt6/QtCore/qcompare_impl.h:26:67: error: 'T' does not refer to a value
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                                                                   ^
/usr/include/qt6/QtCore/qcompare_impl.h:26:24: note: declared here
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                        ^
/usr/include/qt6/QtCore/qcompare_impl.h:26:77: error: expected member name or ';' after declaration specifiers
   26 |     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
      |                                                                             ^

I noticed because I was making a Gentoo package for it, and Gentoo's CMake build handler sets this option.

Patch here: 0001-Include-type_traits-to-fix-error-when-compiling-with.patch

Steps to reproduce

Version information

KitsuneRal commented 12 hours ago

Good find, thanks for spotting.