From cf8f25b1834dab37e268e68eafe374d6caca6e4b Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Wed, 21 Dec 2022 16:44:08 +0100 Subject: [PATCH] =?UTF-8?q?build(cmake):=20always=20mark=20HAS=5FSTRING=5F?= =?UTF-8?q?VIEW=20as=20part=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …of the interface 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. You can find a longer explanation here: --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a25daa..12f0e46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,8 @@ else() endif() if ( DISABLE_STRING_VIEW ) target_compile_definitions( date INTERFACE HAS_STRING_VIEW=0 -DHAS_DEDUCTION_GUIDES=0 ) +else() + target_compile_definitions( date INTERFACE HAS_STRING_VIEW=1 ) endif() #[===================================================================[