Build failure when Catch2 is installed in the system #2722
Labels
Building and Packaging
Issues affecting build/packaging scripts and utilities
Good First Issue
Issues that can be undertaken by someone new to the project
Describe the bug
Waybar application uses Catch2 as a subproject and has dependency on it. See Waybar test main.cpp. It includes Catch headers like:
#include <catch2/catch_all.hpp>
When Catch2 is not installed in the system meson downloads and provides necessary dependencies for Catch2 subproject automatically. When Catch2 is installed in the system, meson provides necessary headers are installed in the system.
Then
catch_all.hpp
header includes #include <catch2/matchers/catch_matchers_all.hpp>. Thencatch_matchers_all.hpp
includes #include <catch2/matchers/catch_matchers_range_equals.hpp> .If we check meson.build we don't see
catch_matchers_range_equals.hpp
header should be installed in the system. For Catch2 itself building and installation process it's not an issue.... butWhen external Application is trying to use Catch2 as a library and tries to include
#include <catch2/catch_all.hpp>
it will get a compiler error due to by the chain builder will not find catch_matchers_range_equals.hpp due to according meson.build it won't been installed.So for now with installed catch2 version 3.3.2 during Waybar build process we've got an error:
FAILED: test/waybar_test.p/main.cpp.o c++ -Itest/waybar_test.p -Itest -I../test -I../include -I/usr/include/gtkmm-3.0 -I/usr/lib64/gtkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I/usr/include/pangomm-1.4 -I/usr/lib64/pangomm-1.4/include -I/usr/include/atkmm-1.6 -I/usr/lib64/atkmm-1.6/include -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib64/gdkmm-3.0/include -I/usr/include/jsoncpp -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -O3 '-DVERSION="0.9.19-29-gdffba784 (branch '"'"'master'"'"')"' -DHAVE_LANGINFO_1STDAY '-DSYSCONFDIR="//usr/local/etc"' -DHAVE_CPU_LINUX -DHAVE_MEMORY_LINUX -DHAVE_SWAY -DHAVE_WLR -DHAVE_RIVER -DHAVE_DWL -DHAVE_HYPRLAND -DHAVE_LIBNL -DHAVE_GAMEMODE -DHAVE_UPOWER -DHAVE_LIBPULSE -DHAVE_LIBJACK -DHAVE_LIBWIREPLUMBER -DHAVE_DBUSMENU -DHAVE_LIBUDEV -DHAVE_LIBEVDEV -DHAVE_LIBINPUT -DHAVE_GTK_LAYER_SHELL -DHAVE_GIO_UNIX -DHAVE_LIBDATE -DHAVE_LIBCAVA -DONLY_C_LOCALE=0 -DUSE_OS_TZDB=1 -DSPDLOG_SHARED_LIB -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -pthread -MD -MQ test/waybar_test.p/main.cpp.o -MF test/waybar_test.p/main.cpp.o.d -o test/waybar_test.p/main.cpp.o -c ../test/main.cpp In file included from /usr/include/catch2/catch_all.hpp:123, from ../test/main.cpp:7: /usr/include/catch2/matchers/catch_matchers_all.hpp:30:10: fatal error: catch2/matchers/catch_matchers_range_equals.hpp: No such file or directory 30 | #include <catch2/matchers/catch_matchers_range_equals.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
Expected behavior
External application should be built successful with catch2 dependencies
Reproduction steps
Platform information:
Additional context
The text was updated successfully, but these errors were encountered: