]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Configure nonstd::string_view to don’t fall back to std::string_view
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Jan 2021 14:43:50 +0000 (15:43 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Jan 2021 14:55:08 +0000 (15:55 +0100)
This makes the code base use nonstd::string regardless of the C++ target
version, which avoids some compatibilty issues.

This decision can be revisited in the future when C++17 is the lower
bar.

Closes #749.

src/CMakeLists.txt

index a88efc985ef884832e64b0fc18a868dee1d7196b..30a2f92c2633353db55929608fcfbb6c1349ce61 100644 (file)
@@ -52,6 +52,9 @@ if(WIN32)
 endif()
 
 add_library(ccache_lib STATIC ${source_files})
+target_compile_definitions(
+  ccache_lib PUBLIC -Dnssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD
+)
 
 if(WIN32)
   target_link_libraries(ccache_lib PRIVATE ws2_32 "psapi")