HowardHinnant / date

A date and time library based on the C++11/14/17 <chrono> header
Other
3.08k stars 669 forks source link

build(cmake): always mark HAS_STRING_VIEW as part of the interface #766

Open Tachi107 opened 1 year ago

Tachi107 commented 1 year ago

If the library gets compiled with HAS_STRING_VIEW=1, consumers always need to link to the functions using std::string_view, as they are the only ones compiled into the shared library.

If the library gets compiled with e.g. C++17 and the user uses an older standard version they'll still get an error, but an helpful compile-time one suggesting to enable C++17 mode, instead of a cryptic linking error.

You can find a longer explanation here: https://github.com/HowardHinnant/date/pull/754#issuecomment-1361248007