rss: Build common code as a shared private library
I'm packaging Evolution for Chimera Linux, which builds software with Clang and with -flto=thin
by default. However, that causes Evolution to print this output on startup then get stuck forever:
(evolution:2415): GLib-GObject-CRITICAL **: 00:49:27.029: cannot register existing type 'CamelRssStoreSummary'
(evolution:2415): GLib-GObject-CRITICAL **: 00:49:27.029: cannot add private field to invalid (non-instantiatable) type '<invalid>'
(evolution:2415): GLib-CRITICAL **: 00:49:27.029: g_once_init_leave: assertion 'result != 0' failed
(evolution:2415): module-rss-CRITICAL **: 00:49:27.029: camel_rss_store_summary_load: assertion 'CAMEL_IS_RSS_STORE_SUMMARY (self)' failed
This doesn't happen when Evolution is built with full LTO (-flto
) or without any LTO at all.
I think the problem happens because src/modules/rss/camel-rss-store-summary.c
is built in both src/modules/rss/camel/CMakeLists.txt
and src/modules/rss/evolution/CMakeLists.txt
.