jtv / libpqxx

The official C++ client API for PostgreSQL.
http://pqxx.org/pqxx/
BSD 3-Clause "New" or "Revised" License
962 stars 228 forks source link

CMakeLists.txt update c++ standard to 20 #785

Closed leleftheriades closed 4 months ago

leleftheriades commented 5 months ago

Curently the cmake file is configured to 17 standard

tt4g commented 5 months ago

The current minimum required C++ version is C++17. The default C++ version cannot be changed to C++20.

You can build with C++20 by defining CMAKE_CXX_STANDARD when you run the cmake command (e.g. cmake -DCMAKE_CXX_STANDARD=20).

jtv commented 5 months ago

Exactly. I plan to stop supporting C++17 soon, but then the whole game will just start over again with C++20 vs. C++23.

leleftheriades commented 4 months ago

I tried to link the library which got built with default options to a c++20 project and got linker errors in msvc, so i assumed the support for c++17 was dropped that was why i raised an issue. Thank u, i will use the cmake command line argument to ensure i get the version i want

jtv commented 4 months ago

Yes, it's a thorny issue that the package managers are totally ignoring: you can't reliably link code compiled in one C++ version to code compiled in another.

Perhaps the worst part is that it sometimes works. At least when it breaks consistently you will know when it needs fixing.