Skip to content

Commit

Permalink
build(cmake): always mark HAS_STRING_VIEW as part…
Browse files Browse the repository at this point in the history
…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:
<#754 (comment)>
  • Loading branch information
Tachi107 authored and HowardHinnant committed Sep 28, 2024
1 parent dc9d161 commit cf8f25b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

#[===================================================================[
Expand Down

0 comments on commit cf8f25b

Please sign in to comment.