Bug 430331 - Enforcing of C++11 standard breaks build with boost 1.75
Summary: Enforcing of C++11 standard breaks build with boost 1.75
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.4.1
Platform: Arch Linux Linux
: HI grave
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-13 11:25 UTC by Antonio Rojas
Modified: 2020-12-15 21:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.4.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2020-12-13 11:25:01 UTC
SUMMARY
krita enforces C++11 standard in its CMakeLists.txt, breaking build with boost 1.75, which requires C++14

/usr/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp: In function ‘void boost::geometry::sectionalize(const Geometry&, const RobustPolicy&, Sections&, int, std::size_t)’:
/usr/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp:1076:18: error: ‘conditional_t’ is not a member of ‘std’; did you mean ‘conditional’?
 1076 |             std::conditional_t
      |                  ^~~~~~~~~~~~~


Note that removing the C++11 enforcement from CMakeLists will not fix it since KDECompilerSettings from ECM will still set it to C++11, one needs to set it to C++14 explicitly to fix the build.
Comment 1 Kuntal Majumder 2020-12-13 11:34:18 UTC
Unless we can push to C++14 which I am not sure of, they only solution seems to add something like this,

#if __cplusplus == 201103L
template< bool B, class T, class F >
using conditional_t = typename conditional<B,T,F>::type; 
#endif

to the boost header temporarily for the build, I guess.
Comment 2 amyspark 2020-12-13 11:54:18 UTC
I think we can elevate the required C++ standard in CMakeLists.txt if we detect Boost 1.75+, e.g. https://invent.kde.org/graphics/kseexpr/-/blob/master/src/KSeExpr/CMakeLists.txt#L127-129 or with set(CMAKE_CXX_STANDARD 14).

Setting to Arch, elevating severity because this is an insta-break on rolling release distros. (So expecting Manjaro will break soon.)
Comment 3 Bug Janitor Service 2020-12-13 23:27:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/618
Comment 5 amyspark 2020-12-15 21:31:25 UTC
Git commit 03ff1bae4348a71987c69bb3746cfa6c15d53862 by L. E. Segovia.
Committed on 15/12/2020 at 21:27.
Pushed by lsegovia into branch 'krita/4.3'.

Upgrade C++ standard to 14 if Boost >= 1.75

This only affects compilation if a recent enough Boost is detected.

CCMAIL: kimageshop@kde.org

M  +4    -0    CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/03ff1bae4348a71987c69bb3746cfa6c15d53862
Comment 6 amyspark 2020-12-15 21:32:44 UTC
Git commit 75a9c5ba57c96e2a1c881aefd6eb0f4760b506a3 by L. E. Segovia.
Committed on 15/12/2020 at 21:31.
Pushed by lsegovia into branch 'krita/4.4.2'.

Upgrade C++ standard to 14 if Boost >= 1.75

This only affects compilation if a recent enough Boost is detected.

CCMAIL: kimageshop@kde.org
(cherry picked from commit 03ff1bae4348a71987c69bb3746cfa6c15d53862)

M  +4    -0    CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/75a9c5ba57c96e2a1c881aefd6eb0f4760b506a3