build: Make it possible to override C++ standard
Latest version of abseil
library required by libphonenumber
requires C++17, but setting -DCMAKE_CXX_STANDARD=17
for evolution-data-server
isn't propagated correctly for all targets.
See merge request and build log.
[227/937] Building CXX object src/addressbook/libebook-contacts/CMakeFiles/ephonenumber-private.dir/e-phone-number-private.cpp.o
FAILED: src/addressbook/libebook-contacts/CMakeFiles/ephonenumber-private.dir/e-phone-number-private.cpp.o
/usr/bin/c++ -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_68 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_68 -DG_LOG_DOMAIN=\"e-phone-number\" -DLIBEBOOK_CONTACTS_COMPILATION -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_3_2 -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_3_2 -D_LARGEFILE64_SOURCE=1 -I/run/build/evolution-data-server -I/run/build/evolution-data-server/src -I/run/build/evolution-data-server/src/addressbook/libebook-contacts -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libxml2 -I/usr/include/libsoup-3.0 -I/usr/include/libsecret-1 -I/usr/include/gio-unix-2.0 -I//include -Wnoexcept -Wno-missing-include-dirs -Wno-deprecated-declarations -fno-strict-aliasing -Wl,--no-undefined -Wno-cast-function-type -Wwrite-strings -Wundef -Wredundant-decls -Wpointer-arith -Wmissing-noreturn -Wmissing-declarations -Winit-self -Wformat-security -Wformat -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -fPIC -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libxml2 -I/usr/include/libsoup-3.0 -I/usr/include/libsecret-1 -I/usr/include/gio-unix-2.0 -pthread -I/usr/include/aarch64-linux-gnu -std=gnu++14 -MD -MT src/addressbook/libebook-contacts/CMakeFiles/ephonenumber-private.dir/e-phone-number-private.cpp.o -MF src/addressbook/libebook-contacts/CMakeFiles/ephonenumber-private.dir/e-phone-number-private.cpp.o.d -o src/addressbook/libebook-contacts/CMakeFiles/ephonenumber-private.dir/e-phone-number-private.cpp.o -c /run/build/evolution-data-server/src/addressbook/libebook-contacts/e-phone-number-private.cpp
In file included from /app/include/absl/container/internal/compressed_tuple.h:40,
from /app/include/absl/container/fixed_array.h:50,
from /app/include/absl/hash/internal/hash.h:48,
from /app/include/absl/hash/hash.h:85,
from /app/include/absl/container/internal/hash_function_defaults.h:55,
from /app/include/absl/container/node_hash_set.h:42,
from /app/include/phonenumbers/phonenumberutil.h:33,
from /run/build/evolution-data-server/src/addressbook/libebook-contacts/e-phone-number-private.cpp:37:
/app/include/absl/utility/utility.h:164:12: error: ‘in_place_t’ has not been declared in ‘std’
164 | using std::in_place_t;
| ^~~~~~~~~~
When forcing compiler option via -std=c++17
, then the build still fails with latest abseil version 20230125.0
. It seems to be overwritten to -std=gnu++14
somewhere.
Edited by Dark Dragon